Panic if can't make a JIT while creating a context

This commit is contained in:
Sameer Rahmani 2022-02-23 12:51:54 +00:00
parent 840a7c565c
commit 6eaba7dbe8
1 changed files with 3 additions and 7 deletions

View File

@ -224,14 +224,10 @@ public:
// Make serene.user which is the defult NS available on the
// JIT
auto loc = reader::LocationRange::UnknownLocation(INTERNAL_NS);
auto err = ctx->jit->addNS(*ns, loc);
// TODO: Fix this by calling to the diag engine
if (err) {
llvm::errs() << err << "\n";
serene::terminate(*ctx, 1);
return nullptr;
if (auto err = ctx->jit->addNS(*ns, loc)) {
panic(*ctx, err);
}
return ctx;
};