1
0
mirror of https://github.com/exaloop/codon.git synced 2025-06-03 15:03:52 +08:00

Fix globals in JIT

This commit is contained in:
Ibrahim Numanagić 2022-09-29 19:32:55 -07:00
parent 010fa3b347
commit 7655e09e83

View File

@ -154,7 +154,7 @@ StmtPtr SimplifyVisitor::transformAssignment(ExprPtr lhs, ExprPtr rhs, ExprPtr t
// Register all toplevel variables as global in JIT mode
bool isGlobal =
(ctx->cache->isJit && ctx->isGlobal() && getStaticGeneric(type.get()) != 0) ||
(ctx->cache->isJit && ctx->isGlobal() && getStaticGeneric(type.get()) == 0) ||
(canonical == VAR_ARGV);
if (isGlobal && !getStaticGeneric(type.get()))
ctx->cache->addGlobal(canonical);