Copy InitialInstructions to prevent mutation

This commit is contained in:
Derek Parker 2015-04-15 14:08:18 -05:00
parent 20c9e92cec
commit 8ebab600f0

@ -119,6 +119,8 @@ var fnlookup = map[byte]instruction{
}
func executeCIEInstructions(cie *CommonInformationEntry) *FrameContext {
initialInstructions := make([]byte, len(cie.InitialInstructions))
copy(initialInstructions, cie.InitialInstructions)
frame := &FrameContext{
cie: cie,
regs: make(map[uint64]DWRule),
@ -126,7 +128,7 @@ func executeCIEInstructions(cie *CommonInformationEntry) *FrameContext {
prevRegs: make(map[uint64]DWRule),
codeAlignment: cie.CodeAlignmentFactor,
dataAlignment: cie.DataAlignmentFactor,
buf: bytes.NewBuffer(cie.InitialInstructions),
buf: bytes.NewBuffer(initialInstructions),
}
frame.ExecuteDwarfProgram()