Skip to content

Commit

Permalink
Fixed bug in recursive proc calls
Browse files Browse the repository at this point in the history
  • Loading branch information
neilsf committed Oct 28, 2020
1 parent 3779441 commit 3ab2e7c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.3.05
v2.3.06
2 changes: 1 addition & 1 deletion source/app.d
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ string listfile="";
* Version
*/

string compiler_version = "v2.3.05";
string compiler_version = "v2.3.06";

/**
* Application entry point
Expand Down
13 changes: 7 additions & 6 deletions source/statement/call_stmt.d
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ class Call_stmt:Stmt
}
this.program.error(error);
}

bool recursive = false;
if(lbl == this.program.current_proc_name) {
recursive = true;
this.program.appendProgramSegment(this.program.push_locals());
}

Procedure proc = this.program.findProcedure(lbl);
if(this.node.children[0].children.length > 1) {
ParseTree exprlist = this.node.children[0].children[1];
Expand All @@ -45,12 +52,6 @@ class Call_stmt:Stmt
}
}

bool recursive = false;
if(lbl == this.program.current_proc_name) {
recursive = true;
this.program.appendProgramSegment(this.program.push_locals());
}

this.program.appendProgramSegment("\tjsr " ~ proc.getLabel() ~ "\n");

if(recursive) {
Expand Down

0 comments on commit 3ab2e7c

Please sign in to comment.