diff options
Diffstat (limited to '')
| -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) |
