diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-07-12 11:38:42 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-07-12 11:38:42 -0300 |
commit | f6aab3ec1f111cd8d968bdcb7ca800e93b819d24 (patch) | |
tree | 4c36c418ecc9062e6d95de73457198b38b0afce9 /lundump.c | |
parent | be8445d7e4b6122620c428877b51a27d464253d5 (diff) | |
download | lua-github-f6aab3ec1f111cd8d968bdcb7ca800e93b819d24.tar.gz |
First implementation of constant propagation
Local constant variables initialized with compile-time constants
are optimized away from the code.
Diffstat (limited to 'lundump.c')
-rw-r--r-- | lundump.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -198,12 +198,11 @@ static void LoadUpvalues (LoadState *S, Proto *f) { n = LoadInt(S); f->upvalues = luaM_newvectorchecked(S->L, n, Upvaldesc); f->sizeupvalues = n; - for (i = 0; i < n; i++) - f->upvalues[i].name = NULL; for (i = 0; i < n; i++) { + f->upvalues[i].name = NULL; f->upvalues[i].instack = LoadByte(S); f->upvalues[i].idx = LoadByte(S); - f->upvalues[i].ro = LoadByte(S); + f->upvalues[i].kind = LoadByte(S); } } |