Skip to content

Commit

Permalink
Fix func resolution when func in mid parent
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxiaomao committed Jun 18, 2024
1 parent a5667c3 commit fc4cc29
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions hld/Module.hx
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,12 @@ class Module {
var idx = functionsIndexes.get(m.findex);
var f = code.functions[idx];
// parent methods are placed before child
if( parent != null && m.pindex >= 0) {
if( parent != null && m.pindex >= 0 ) {
var v = parent.methods.get(m.name);
methods.set(m.name, { t : f.t, index : v.index, pindex : m.pindex });
if( v != null )
methods.set(m.name, { t : f.t, index : v.index, pindex : m.pindex });
else
methods.set(m.name, { t : f.t, index : mindex++, pindex : m.pindex });
} else {
methods.set(m.name, { t : f.t, index : mindex++, pindex : m.pindex });
}
Expand Down

0 comments on commit fc4cc29

Please sign in to comment.