3 source/interpret.c | 13 ++++++++-----
4 source/interpret.h | 1 +
5 2 files changed, 9 insertions(+), 5 deletions(-)
7 diff --quilt old/source/interpret.c new/source/interpret.c
8 --- old/source/interpret.c
9 +++ new/source/interpret.c
10 @@ -292,17 +292,16 @@ AccumulatorData *BeginCreatingProgram(co
11 Program *FinishCreatingProgram(AccumulatorData *old)
16 newProg = XtNew(Program);
17 newProg->name = LookupString(ProgramName, True);
18 - progLen = ProgP - Prog;
19 - newProg->code = (Inst *)XtCalloc(progLen, sizeof(Inst));
20 - memcpy(newProg->code, Prog, progLen * sizeof(Inst));
21 + newProg->progLen = ProgP - Prog;
22 + newProg->code = (Inst *)XtCalloc(newProg->progLen, sizeof(Inst));
23 + memcpy(newProg->code, Prog, newProg->progLen * sizeof(Inst));
24 newProg->nested = False;
25 newProg->refcount = 0;
27 - DISASM(newProg->name, newProg->code, ProgP - Prog);
28 + DISASM(newProg->name, newProg->code, newProg->progLen);
30 XtFree((char *)Accumulator);
32 @@ -1265,6 +1264,10 @@ static void addToGlobalSymTab(Symbol *sy
36 + Program *prog = FP_GET_PROG(FrameP); \
37 + if (!(prog->code <= (a) && (a) < (prog->code + prog->progLen))) { \
38 + EXEC_ERROR("Branch target outside current frame", NULL); \
43 diff --quilt old/source/interpret.h new/source/interpret.h
44 --- old/source/interpret.h
45 +++ new/source/interpret.h
46 @@ -122,6 +122,7 @@ typedef struct SymbolRec {
48 typedef struct ProgramTag {