Fix generation of multiple functions
authorSimon Hausmann <simon.hausmann@digia.com>
Tue, 2 Oct 2012 06:53:47 +0000 (08:53 +0200)
committerSimon Hausmann <simon.hausmann@digia.com>
Tue, 2 Oct 2012 06:53:47 +0000 (08:53 +0200)
Sine we can't reset the MacroAssembler properly right now, reconstruct
the isel for every function.

main.cpp

index 460663a..fa03e08 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -227,9 +227,10 @@ static void evaluate(QQmlJS::VM::Context *ctx, const QString &fileName, const QS
                 foreach (IR::Function *function, module.functions)
                     isel(function);
             } else {
-                MASM::InstructionSelection isel(vm, &module, code);
-                foreach (IR::Function *function, module.functions)
+                foreach (IR::Function *function, module.functions) {
+                    MASM::InstructionSelection isel(vm, &module, code);
                     isel(function);
+                }
 
                 if (! protect(code, codeSize))
                     Q_UNREACHABLE();