Skip to content

Commit

Permalink
fix #77 bug, set caller's funcID not callee's funcID in inlineNode bug
Browse files Browse the repository at this point in the history
  • Loading branch information
pkujhd committed May 22, 2023
1 parent 0c56c4b commit 09f36c8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion inlinetree.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ func (linker *Linker) addInlineTree(_func *_func, symbol *obj.ObjSymbol) (err er

bytes := make([]byte, len(Func.InlTree)*obj.InlinedCallSize)
for k, inl := range Func.InlTree {
inlinedcall := obj.InitInlinedCall(inl, getfuncID(_func), linker.nameMap, linker.filetab)
funcID := uint8(0)
if _, ok := linker.objsymbolMap[inl.Func]; ok {
funcID = linker.objsymbolMap[inl.Func].Func.FuncID
}
inlinedcall := obj.InitInlinedCall(inl, funcID, linker.nameMap, linker.filetab)
copy2Slice(bytes[k*obj.InlinedCallSize:], uintptr(unsafe.Pointer(&inlinedcall)), obj.InlinedCallSize)
}
offset := len(linker.noptrdata)
Expand Down

0 comments on commit 09f36c8

Please sign in to comment.