提交 8ebab600 编写于 作者: D Derek Parker

Copy InitialInstructions to prevent mutation

上级 20c9e92c
...@@ -119,6 +119,8 @@ var fnlookup = map[byte]instruction{ ...@@ -119,6 +119,8 @@ var fnlookup = map[byte]instruction{
} }
func executeCIEInstructions(cie *CommonInformationEntry) *FrameContext { func executeCIEInstructions(cie *CommonInformationEntry) *FrameContext {
initialInstructions := make([]byte, len(cie.InitialInstructions))
copy(initialInstructions, cie.InitialInstructions)
frame := &FrameContext{ frame := &FrameContext{
cie: cie, cie: cie,
regs: make(map[uint64]DWRule), regs: make(map[uint64]DWRule),
...@@ -126,7 +128,7 @@ func executeCIEInstructions(cie *CommonInformationEntry) *FrameContext { ...@@ -126,7 +128,7 @@ func executeCIEInstructions(cie *CommonInformationEntry) *FrameContext {
prevRegs: make(map[uint64]DWRule), prevRegs: make(map[uint64]DWRule),
codeAlignment: cie.CodeAlignmentFactor, codeAlignment: cie.CodeAlignmentFactor,
dataAlignment: cie.DataAlignmentFactor, dataAlignment: cie.DataAlignmentFactor,
buf: bytes.NewBuffer(cie.InitialInstructions), buf: bytes.NewBuffer(initialInstructions),
} }
frame.ExecuteDwarfProgram() frame.ExecuteDwarfProgram()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册