From ee0166c83cd91a469bbe2d1da3c27f180da7b582 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sun, 14 Nov 2010 21:23:48 -0800 Subject: handle global constants that are llvm function calls +test --- src/postamble.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/postamble.js') diff --git a/src/postamble.js b/src/postamble.js index 066b83e3..010e6e66 100644 --- a/src/postamble.js +++ b/src/postamble.js @@ -13,13 +13,14 @@ function run(args) { counter--; var func = globalFuncs.pop(); try { - func(); + var x = func(); + if (x == undefined) throw 'undefined'; } catch (e) { globalFuncs.unshift(func); // We will try again later. The global vars we depend on should be resolved by then - // XXX: We leak here, as we malloc, then fail and catch... } } + assert(counter > 0); var argc = args.length+1; function pad() { -- cgit v1.2.3-18-g5258