renamed patch_long_forward_jump_instruction() to patch_forward_jump_instruction().

enhanced to change a forward jump to a backward jump if target ip is less than the instruction pointer
This commit is contained in:
hyunghwan.chung
2019-08-02 09:32:19 +00:00
parent bd3fc07aaa
commit e08edffb0c
2 changed files with 24 additions and 11 deletions

View File

@ -52,6 +52,18 @@ class MyObject(Object)
].
}
method(#class) q
{
| v |
v := 0.
start:
if (v > 100) { ^nil }.
v dump.
v := v + 1.
goto start.
}
method(#class) main
{
| tc limit |
@ -94,6 +106,7 @@ class MyObject(Object)
].
(if (true) { a: 10. b: 1p1000. c: 20000 }) dump.
[goto B02. A01: 10. B02: 1000. ] value class dump.
self q.
EXCEPTION_TEST:
Exception signal: 'experiment with exception signalling'.