From: fennecdjay Date: Thu, 10 Oct 2019 12:24:02 +0000 (+0200) Subject: :art: TestPushStaticCode X-Git-Tag: nightly~2198^2~24 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=bb656627631b860d2ba79c3cc3ab772fe7ed4336;p=gwion.git :art: TestPushStaticCode --- diff --git a/src/vm/vm.c b/src/vm/vm.c index 1322f615..55e9c921 100644 --- a/src/vm/vm.c +++ b/src/vm/vm.c @@ -798,9 +798,9 @@ PRAGMA_PUSH() PRAGMA_POP() DISPATCH() pushstaticcode: - *(m_bit*)byte = eRegPushImm; - VAL = (*(m_uint*)(reg) = (m_uint)((Func)VAL)->code); - reg += SZ_INT; + *(m_bit*)byte = eRegSetImm; + VAL = (*(m_uint*)(reg-SZ_INT) = (m_uint)((Func)VAL)->code); + VAL2 = -SZ_INT; DISPATCH() gcini: vector_add(&shred->gc, 0); diff --git a/tests/tree/push_staticcode.gw b/tests/tree/push_staticcode.gw new file mode 100644 index 00000000..c9f61720 --- /dev/null +++ b/tests/tree/push_staticcode.gw @@ -0,0 +1,11 @@ +fun void test() { + test(2); +} +fun void test(int i) { + <<< i >>>; +} +test(); +test(); + + +