diff --git a/dwarf/frame/table.go b/dwarf/frame/table.go index 84c5f407d95e0fac38e74331082a6002f58a6de0..bd871766db27ad64711f791569fe8ac59f24f93b 100644 --- a/dwarf/frame/table.go +++ b/dwarf/frame/table.go @@ -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()