Skip to content

Commit

Permalink
Fix single captured detection, and when r0 is also alias of local var
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxiaomao committed Jun 18, 2024
1 parent ece6460 commit 04ea282
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hld/CodeGraph.hx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class CodeGraph {
}
var r = -a.position - 2;
var vars;
if( r != reg ) {
if( r != reg && a.position != -1) {
reg = r;
vars = [];
args.unshift({ hasIndex : true, vars : vars });
Expand All @@ -94,7 +94,7 @@ class CodeGraph {
}

// single captured pointer => passed directly
if( args.length >= 1 && args[0].hasIndex && args[0].vars.length == 1 && !f.regs[0].match(HEnum({name:""})) )
if( args.length >= 1 && args[0].hasIndex && !f.regs[0].match(HEnum({name:null})) )
args[0].hasIndex = false;

if( args.length == nargs - 1 )
Expand Down

0 comments on commit 04ea282

Please sign in to comment.