summaryrefslogtreecommitdiff
path: root/undump.c
diff options
context:
space:
mode:
authorLuiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br>1996-02-24 00:46:57 -0300
committerLuiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br>1996-02-24 00:46:57 -0300
commitb3c10c8c41d2785bb6a9cec55851e2d66ff872a7 (patch)
tree43f008cd2afd548a32bc40641346ca535496218b /undump.c
parent5c1bd89a1cc6ec235687f81f4465d0fb85bc0e15 (diff)
downloadlua-b3c10c8c41d2785bb6a9cec55851e2d66ff872a7.tar.gz
lua-b3c10c8c41d2785bb6a9cec55851e2d66ff872a7.tar.bz2
lua-b3c10c8c41d2785bb6a9cec55851e2d66ff872a7.zip
fix to PUSHFUNCTION now correctly at tf->marked
Diffstat (limited to 'undump.c')
-rw-r--r--undump.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/undump.c b/undump.c
index a5f6138b..cf96a784 100644
--- a/undump.c
+++ b/undump.c
@@ -3,7 +3,7 @@
3** load bytecodes from files 3** load bytecodes from files
4*/ 4*/
5 5
6char *rcs_undump="$Id: undump.c,v 1.1 1996/02/23 19:04:38 lhf Exp lhf $"; 6char *rcs_undump="$Id: undump.c,v 1.2 1996/02/23 22:00:26 lhf Exp lhf $";
7 7
8#include <stdio.h> 8#include <stdio.h>
9#include <string.h> 9#include <string.h>
@@ -69,7 +69,7 @@ static void LoadFunction(FILE *D)
69 else /* fix PUSHFUNCTION */ 69 else /* fix PUSHFUNCTION */
70 { 70 {
71 CodeCode c; 71 CodeCode c;
72 Byte *p=Main->code; 72 Byte *p=Main->code+tf->marked; /* TODO: tf->marked=? */
73 c.tf=tf; 73 c.tf=tf;
74 *p++=c.m.c1; *p++=c.m.c2; *p++=c.m.c3; *p++=c.m.c4; 74 *p++=c.m.c1; *p++=c.m.c2; *p++=c.m.c3; *p++=c.m.c4;
75 } 75 }
@@ -92,6 +92,7 @@ static void LoadFunction(FILE *D)
92 } 92 }
93 else 93 else
94 { 94 {
95printf("tf=%p\n",tf);
95PrintFunction(tf); /* TODO: remove */ 96PrintFunction(tf); /* TODO: remove */
96 ungetc(c,D); 97 ungetc(c,D);
97 return; 98 return;
@@ -121,7 +122,7 @@ static void LoadChunk(FILE *D)
121 int c=getc(D); 122 int c=getc(D);
122 if (c=='F') LoadFunction(D); else { ungetc(c,D); break; } 123 if (c=='F') LoadFunction(D); else { ungetc(c,D); break; }
123 } 124 }
124 /* TODO: run Main */ 125PrintFunction(Main); /* TODO: run Main */
125} 126}
126 127
127void Undump(FILE *D) 128void Undump(FILE *D)