diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-01-10 13:54:51 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-01-10 13:54:51 -0300 |
commit | 7ca3c40b50b385ead6b8bc4c54de97b61d11a12a (patch) | |
tree | 5c5998f39760b07e05135df56b8a828f2fb685c1 /testes/db.lua | |
parent | 8a3a49250ce4a7e46ec9e90810a61d9f97aece3d (diff) | |
download | lua-7ca3c40b50b385ead6b8bc4c54de97b61d11a12a.tar.gz lua-7ca3c40b50b385ead6b8bc4c54de97b61d11a12a.tar.bz2 lua-7ca3c40b50b385ead6b8bc4c54de97b61d11a12a.zip |
Another way to compile goto's
The compilation of a goto or a label just create an entry and generate
boilerplate code for the gotos. As we don't know yet whether it needs a
CLOSE, we code a jump followed by a CLOSE, which is then dead code.
When a block ends (and then we know for sure whether there are variables
that need to be closed), we check the goto's against the labels of that
block. When closing a goto against a label, if it needs a CLOSE, the
compiler swaps the order of the jump and the CLOSE, making the CLOSE
active.
Diffstat (limited to 'testes/db.lua')
-rw-r--r-- | testes/db.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/testes/db.lua b/testes/db.lua index fc0db9ea..75730d27 100644 --- a/testes/db.lua +++ b/testes/db.lua | |||
@@ -128,7 +128,7 @@ then | |||
128 | else | 128 | else |
129 | a=2 | 129 | a=2 |
130 | end | 130 | end |
131 | ]], {2,3,4,7}) | 131 | ]], {2,4,7}) |
132 | 132 | ||
133 | 133 | ||
134 | test([[ | 134 | test([[ |