diff options
| author | Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> | 1996-02-24 00:46:57 -0300 |
|---|---|---|
| committer | Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> | 1996-02-24 00:46:57 -0300 |
| commit | b3c10c8c41d2785bb6a9cec55851e2d66ff872a7 (patch) | |
| tree | 43f008cd2afd548a32bc40641346ca535496218b | |
| parent | 5c1bd89a1cc6ec235687f81f4465d0fb85bc0e15 (diff) | |
| download | lua-b3c10c8c41d2785bb6a9cec55851e2d66ff872a7.tar.gz lua-b3c10c8c41d2785bb6a9cec55851e2d66ff872a7.tar.bz2 lua-b3c10c8c41d2785bb6a9cec55851e2d66ff872a7.zip | |
fix to PUSHFUNCTION now correctly at tf->marked
| -rw-r--r-- | undump.c | 7 |
1 files changed, 4 insertions, 3 deletions
| @@ -3,7 +3,7 @@ | |||
| 3 | ** load bytecodes from files | 3 | ** load bytecodes from files |
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | char *rcs_undump="$Id: undump.c,v 1.1 1996/02/23 19:04:38 lhf Exp lhf $"; | 6 | char *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 | { |
| 95 | printf("tf=%p\n",tf); | ||
| 95 | PrintFunction(tf); /* TODO: remove */ | 96 | PrintFunction(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 */ | 125 | PrintFunction(Main); /* TODO: run Main */ |
| 125 | } | 126 | } |
| 126 | 127 | ||
| 127 | void Undump(FILE *D) | 128 | void Undump(FILE *D) |
