Repository navigation
Port v1.9.10-rc.1 - #4445
Merged
Merged
Port v1.9.10-rc.1#4445
Conversation
[v1.9] Port v1.9.9-rc.2
…ation Add more tests for auth escalation via storage references
Merge `release/v1.9.9` to `v1.9`
Add test case for getType on reference
…ternal into supun/validate-indexed-type
Defensively validate indexed value's type
Test downcast of base reference in public attachment function
…t-container-reads
…ternal into supun/use-simple-composite-in-stdlibs
…libs Use `SimpleCompositeValue` for test-framework's emulator backend
…lement-container-reads
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
SupunS
approved these changes
Feb 24, 2026
Benchstat comparison
Results
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Port #4444 to
masterConflict resolution
commit 16c369c7cd71271afe4895539f57e40d783c889b Merge: 8fd8bd4ab 7444244b7 Author: Bastian Müller <bastian@turbolent.com> Date: Tue Feb 24 11:07:49 2026 -0800 Merge branch 'bastian/v1.9-port-v1.9.10-rc.1' into bastian/port-v1.9.10-rc.1 diff --git a/bbq/compiler/compiler_test.go b/bbq/compiler/compiler_test.go remerge CONFLICT (content): Merge conflict in bbq/compiler/compiler_test.go index 5260aa4cc..3c976d362 100644 --- a/bbq/compiler/compiler_test.go +++ b/bbq/compiler/compiler_test.go @@ -2256,20 +2256,17 @@ func TestCompileIndex(t *testing.T) { opcode.PrettyInstructionStatement{}, // array[index] -<<<<<<< 8fd8bd4ab (Merge pull request #4440 from onflow/bastian/port-v1.9.9-rc.2) opcode.PrettyInstructionGetLocal{Local: arrayIndex}, opcode.PrettyInstructionGetLocal{Local: indexIndex}, opcode.PrettyInstructionTransferAndConvert{ ValueType: interpreter.PrimitiveStaticTypeInt, TargetType: interpreter.PrimitiveStaticTypeInteger, }, - opcode.PrettyInstructionGetIndex{}, -======= - opcode.InstructionGetLocal{Local: arrayIndex}, - opcode.InstructionGetLocal{Local: indexIndex}, - opcode.InstructionTransferAndConvert{ValueType: 1, TargetType: 2}, - opcode.InstructionGetIndex{IndexedType: 3}, ->>>>>>> 7444244b7 (Merge tag 'v1.9.10-rc.1' into bastian/v1.9-port-v1.9.10-rc.1) + opcode.PrettyInstructionGetIndex{ + IndexedType: &interpreter.VariableSizedStaticType{ + Type: interpreter.PrimitiveStaticTypeInt, + }, + }, // return opcode.PrettyInstructionTransferAndConvert{ @@ -2312,7 +2309,6 @@ func TestCompileAssignIndex(t *testing.T) { ) assert.Equal(t, -<<<<<<< 8fd8bd4ab (Merge pull request #4440 from onflow/bastian/port-v1.9.9-rc.2) []opcode.PrettyInstruction{ opcode.PrettyInstructionStatement{}, opcode.PrettyInstructionGetLocal{Local: arrayIndex}, @@ -2326,19 +2322,12 @@ func TestCompileAssignIndex(t *testing.T) { ValueType: interpreter.PrimitiveStaticTypeInt, TargetType: interpreter.PrimitiveStaticTypeInt, }, - opcode.PrettyInstructionSetIndex{}, + opcode.PrettyInstructionSetIndex{ + IndexedType: &interpreter.VariableSizedStaticType{ + Type: interpreter.PrimitiveStaticTypeInt, + }, + }, opcode.PrettyInstructionReturn{}, -======= - []opcode.Instruction{ - opcode.InstructionStatement{}, - opcode.InstructionGetLocal{Local: arrayIndex}, - opcode.InstructionGetLocal{Local: indexIndex}, - opcode.InstructionTransferAndConvert{ValueType: 1, TargetType: 2}, - opcode.InstructionGetLocal{Local: valueIndex}, - opcode.InstructionTransferAndConvert{ValueType: 1, TargetType: 1}, - opcode.InstructionSetIndex{IndexedType: 3}, - opcode.InstructionReturn{}, ->>>>>>> 7444244b7 (Merge tag 'v1.9.10-rc.1' into bastian/v1.9-port-v1.9.10-rc.1) }, prettyInstructions(functions[0].Code, program), ) @@ -8127,7 +8116,6 @@ func TestCompileLineNumberInfo(t *testing.T) { TargetType: interpreter.PrimitiveStaticTypeInteger, }, // value + value -<<<<<<< 8fd8bd4ab (Merge pull request #4440 from onflow/bastian/port-v1.9.9-rc.2) opcode.PrettyInstructionGetLocal{Local: valueIndex}, opcode.PrettyInstructionGetLocal{Local: valueIndex}, opcode.PrettyInstructionAdd{}, @@ -8135,14 +8123,11 @@ func TestCompileLineNumberInfo(t *testing.T) { ValueType: interpreter.PrimitiveStaticTypeInt, TargetType: interpreter.PrimitiveStaticTypeInt, }, - opcode.PrettyInstructionSetIndex{}, -======= - opcode.InstructionGetLocal{Local: valueIndex}, - opcode.InstructionGetLocal{Local: valueIndex}, - opcode.InstructionAdd{}, - opcode.InstructionTransferAndConvert{ValueType: 1, TargetType: 1}, - opcode.InstructionSetIndex{IndexedType: 3}, ->>>>>>> 7444244b7 (Merge tag 'v1.9.10-rc.1' into bastian/v1.9-port-v1.9.10-rc.1) + opcode.PrettyInstructionSetIndex{ + IndexedType: &interpreter.VariableSizedStaticType{ + Type: interpreter.PrimitiveStaticTypeInt, + }, + }, // return opcode.PrettyInstructionReturn{}, @@ -8965,30 +8950,23 @@ func TestCompileSecondValueAssignment(t *testing.T) { }, // Evaluate the index expression, `y["r"]`, using temp locals. -<<<<<<< 8fd8bd4ab (Merge pull request #4440 from onflow/bastian/port-v1.9.9-rc.2) opcode.PrettyInstructionGetLocal{Local: tempYIndex}, opcode.PrettyInstructionGetLocal{Local: tempIndexingValueIndex}, opcode.PrettyInstructionTransferAndConvert{ ValueType: stringType, TargetType: stringType, }, - opcode.PrettyInstructionRemoveIndex{}, + opcode.PrettyInstructionRemoveIndex{ + IndexedType: dictionaryType, + }, opcode.PrettyInstructionTransferAndConvert{ ValueType: optionalRType, TargetType: optionalRType, }, -======= - opcode.InstructionGetLocal{Local: tempYIndex}, - opcode.InstructionGetLocal{Local: tempIndexingValueIndex}, - opcode.InstructionTransferAndConvert{ValueType: 3, TargetType: 3}, - opcode.InstructionRemoveIndex{IndexedType: 2}, - opcode.InstructionTransferAndConvert{ValueType: 4, TargetType: 4}, ->>>>>>> 7444244b7 (Merge tag 'v1.9.10-rc.1' into bastian/v1.9-port-v1.9.10-rc.1) // Second value assignment. // y["r"] <- x // `y` and "r" must be loaded from temp locals. -<<<<<<< 8fd8bd4ab (Merge pull request #4440 from onflow/bastian/port-v1.9.9-rc.2) opcode.PrettyInstructionGetLocal{Local: tempYIndex}, opcode.PrettyInstructionGetLocal{Local: tempIndexingValueIndex}, opcode.PrettyInstructionGetLocal{Local: xIndex}, @@ -8996,14 +8974,10 @@ func TestCompileSecondValueAssignment(t *testing.T) { ValueType: rType, TargetType: optionalRType, }, - opcode.PrettyInstructionSetIndex{}, -======= - opcode.InstructionGetLocal{Local: tempYIndex}, - opcode.InstructionGetLocal{Local: tempIndexingValueIndex}, - opcode.InstructionGetLocal{Local: xIndex}, - opcode.InstructionTransferAndConvert{ValueType: 1, TargetType: 4}, - opcode.InstructionSetIndex{IndexedType: 2}, ->>>>>>> 7444244b7 (Merge tag 'v1.9.10-rc.1' into bastian/v1.9-port-v1.9.10-rc.1) + opcode.PrettyInstructionSetIndex{ + // TODO: + IndexedType: dictionaryType, + }, // Store the transferred y-value above (already on stack), to z. // z <- y["r"] @@ -10384,33 +10358,27 @@ func TestCompileSwapIndexInStructs(t *testing.T) { }, // get left value -<<<<<<< 8fd8bd4ab (Merge pull request #4440 from onflow/bastian/port-v1.9.9-rc.2) opcode.PrettyInstructionGetLocal{Local: tempIndex1}, opcode.PrettyInstructionGetLocal{Local: tempIndex2}, - opcode.PrettyInstructionGetIndex{}, + opcode.PrettyInstructionGetIndex{ + IndexedType: &interpreter.VariableSizedStaticType{ + Type: interpreter.PrimitiveStaticTypeString, + }, + }, opcode.PrettyInstructionSetLocal{ -======= - opcode.InstructionGetLocal{Local: tempIndex1}, - opcode.InstructionGetLocal{Local: tempIndex2}, - opcode.InstructionGetIndex{IndexedType: 1}, - opcode.InstructionSetLocal{ ->>>>>>> 7444244b7 (Merge tag 'v1.9.10-rc.1' into bastian/v1.9-port-v1.9.10-rc.1) Local: tempIndex5, IsTempVar: true, }, // get right value -<<<<<<< 8fd8bd4ab (Merge pull request #4440 from onflow/bastian/port-v1.9.9-rc.2) opcode.PrettyInstructionGetLocal{Local: tempIndex3}, opcode.PrettyInstructionGetLocal{Local: tempIndex4}, - opcode.PrettyInstructionGetIndex{}, + opcode.PrettyInstructionGetIndex{ + IndexedType: &interpreter.VariableSizedStaticType{ + Type: interpreter.PrimitiveStaticTypeString, + }, + }, opcode.PrettyInstructionSetLocal{ -======= - opcode.InstructionGetLocal{Local: tempIndex3}, - opcode.InstructionGetLocal{Local: tempIndex4}, - opcode.InstructionGetIndex{IndexedType: 1}, - opcode.InstructionSetLocal{ ->>>>>>> 7444244b7 (Merge tag 'v1.9.10-rc.1' into bastian/v1.9-port-v1.9.10-rc.1) Local: tempIndex6, IsTempVar: true, }, @@ -10432,29 +10400,24 @@ func TestCompileSwapIndexInStructs(t *testing.T) { opcode.PrettyInstructionSetLocal{Local: tempIndex5}, // set right index with left value -<<<<<<< 8fd8bd4ab (Merge pull request #4440 from onflow/bastian/port-v1.9.9-rc.2) opcode.PrettyInstructionGetLocal{Local: tempIndex1}, opcode.PrettyInstructionGetLocal{Local: tempIndex2}, opcode.PrettyInstructionGetLocal{Local: tempIndex6}, - opcode.PrettyInstructionSetIndex{}, + opcode.PrettyInstructionSetIndex{ + IndexedType: &interpreter.VariableSizedStaticType{ + Type: interpreter.PrimitiveStaticTypeString, + }, + }, // set left index with right value opcode.PrettyInstructionGetLocal{Local: tempIndex3}, opcode.PrettyInstructionGetLocal{Local: tempIndex4}, opcode.PrettyInstructionGetLocal{Local: tempIndex5}, - opcode.PrettyInstructionSetIndex{}, -======= - opcode.InstructionGetLocal{Local: tempIndex1}, - opcode.InstructionGetLocal{Local: tempIndex2}, - opcode.InstructionGetLocal{Local: tempIndex6}, - opcode.InstructionSetIndex{IndexedType: 1}, - - // set left index with right value - opcode.InstructionGetLocal{Local: tempIndex3}, - opcode.InstructionGetLocal{Local: tempIndex4}, - opcode.InstructionGetLocal{Local: tempIndex5}, - opcode.InstructionSetIndex{IndexedType: 1}, ->>>>>>> 7444244b7 (Merge tag 'v1.9.10-rc.1' into bastian/v1.9-port-v1.9.10-rc.1) + opcode.PrettyInstructionSetIndex{ + IndexedType: &interpreter.VariableSizedStaticType{ + Type: interpreter.PrimitiveStaticTypeString, + }, + }, // Return opcode.PrettyInstructionReturn{}, @@ -10535,6 +10498,10 @@ func TestCompileSwapIndexInResources(t *testing.T) { Type: rType, } + rArrayType := &interpreter.VariableSizedStaticType{ + Type: rType, + } + assert.Equal(t, []opcode.PrettyInstruction{ opcode.PrettyInstructionStatement{}, @@ -10607,35 +10574,26 @@ func TestCompileSwapIndexInResources(t *testing.T) { }, // get left value -<<<<<<< 8fd8bd4ab (Merge pull request #4440 from onflow/bastian/port-v1.9.9-rc.2) opcode.PrettyInstructionGetLocal{Local: leftTargetIndex}, opcode.PrettyInstructionGetLocal{Local: leftIndexIndex}, - opcode.PrettyInstructionRemoveIndex{PushPlaceholder: true}, + opcode.PrettyInstructionRemoveIndex{ + IndexedType: rArrayType, + PushPlaceholder: true, + }, opcode.PrettyInstructionSetLocal{Local: leftInsertedPlaceholderIndex}, opcode.PrettyInstructionSetLocal{ -======= - opcode.InstructionGetLocal{Local: leftTargetIndex}, - opcode.InstructionGetLocal{Local: leftIndexIndex}, - opcode.InstructionRemoveIndex{IndexedType: 1, PushPlaceholder: true}, - opcode.InstructionSetLocal{Local: leftInsertedPlaceholderIndex}, - opcode.InstructionSetLocal{ ->>>>>>> 7444244b7 (Merge tag 'v1.9.10-rc.1' into bastian/v1.9-port-v1.9.10-rc.1) Local: leftValueIndex, IsTempVar: true, }, // get right value -<<<<<<< 8fd8bd4ab (Merge pull request #4440 from onflow/bastian/port-v1.9.9-rc.2) opcode.PrettyInstructionGetLocal{Local: rightTargetIndex}, opcode.PrettyInstructionGetLocal{Local: rightIndexIndex}, - opcode.PrettyInstructionRemoveIndex{PushPlaceholder: false}, + opcode.PrettyInstructionRemoveIndex{ + IndexedType: rArrayType, + PushPlaceholder: false, + }, opcode.PrettyInstructionSetLocal{ -======= - opcode.InstructionGetLocal{Local: rightTargetIndex}, - opcode.InstructionGetLocal{Local: rightIndexIndex}, - opcode.InstructionRemoveIndex{IndexedType: 1, PushPlaceholder: false}, - opcode.InstructionSetLocal{ ->>>>>>> 7444244b7 (Merge tag 'v1.9.10-rc.1' into bastian/v1.9-port-v1.9.10-rc.1) Local: rightValueIndex, IsTempVar: true, }, @@ -10647,17 +10605,12 @@ func TestCompileSwapIndexInResources(t *testing.T) { opcode.PrettyInstructionJumpIfFalse{Target: 37}, // set left index back with left value -<<<<<<< 8fd8bd4ab (Merge pull request #4440 from onflow/bastian/port-v1.9.9-rc.2) opcode.PrettyInstructionGetLocal{Local: leftTargetIndex}, opcode.PrettyInstructionGetLocal{Local: leftIndexIndex}, opcode.PrettyInstructionGetLocal{Local: leftValueIndex}, - opcode.PrettyInstructionSetIndex{}, -======= - opcode.InstructionGetLocal{Local: leftTargetIndex}, - opcode.InstructionGetLocal{Local: leftIndexIndex}, - opcode.InstructionGetLocal{Local: leftValueIndex}, - opcode.InstructionSetIndex{IndexedType: 1}, ->>>>>>> 7444244b7 (Merge tag 'v1.9.10-rc.1' into bastian/v1.9-port-v1.9.10-rc.1) + opcode.PrettyInstructionSetIndex{ + IndexedType: rArrayType, + }, // jump to the end opcode.PrettyInstructionJump{Target: 51}, @@ -10679,29 +10632,20 @@ func TestCompileSwapIndexInResources(t *testing.T) { opcode.PrettyInstructionSetLocal{Local: leftValueIndex}, // set left index with right value -<<<<<<< 8fd8bd4ab (Merge pull request #4440 from onflow/bastian/port-v1.9.9-rc.2) opcode.PrettyInstructionGetLocal{Local: leftTargetIndex}, opcode.PrettyInstructionGetLocal{Local: leftIndexIndex}, opcode.PrettyInstructionGetLocal{Local: rightValueIndex}, - opcode.PrettyInstructionSetIndex{}, + opcode.PrettyInstructionSetIndex{ + IndexedType: rArrayType, + }, // set right index with left value opcode.PrettyInstructionGetLocal{Local: rightTargetIndex}, opcode.PrettyInstructionGetLocal{Local: rightIndexIndex}, opcode.PrettyInstructionGetLocal{Local: leftValueIndex}, - opcode.PrettyInstructionSetIndex{}, -======= - opcode.InstructionGetLocal{Local: leftTargetIndex}, - opcode.InstructionGetLocal{Local: leftIndexIndex}, - opcode.InstructionGetLocal{Local: rightValueIndex}, - opcode.InstructionSetIndex{IndexedType: 1}, - - // set right index with left value - opcode.InstructionGetLocal{Local: rightTargetIndex}, - opcode.InstructionGetLocal{Local: rightIndexIndex}, - opcode.InstructionGetLocal{Local: leftValueIndex}, - opcode.InstructionSetIndex{IndexedType: 1}, ->>>>>>> 7444244b7 (Merge tag 'v1.9.10-rc.1' into bastian/v1.9-port-v1.9.10-rc.1) + opcode.PrettyInstructionSetIndex{ + IndexedType: rArrayType, + }, // destroy rs opcode.PrettyInstructionStatement{}, @@ -11892,11 +11836,10 @@ func TestCompileAttachments(t *testing.T) { // get s back on stack opcode.PrettyInstructionGetLocal{Local: sTmpLocalIndex}, // attachment operation, attach A to s-copy -<<<<<<< 8fd8bd4ab (Merge pull request #4440 from onflow/bastian/port-v1.9.9-rc.2) - opcode.PrettyInstructionSetTypeIndex{Type: aType}, -======= - opcode.InstructionSetTypeIndex{IndexedType: 1, IndexingType: 3}, ->>>>>>> 7444244b7 (Merge tag 'v1.9.10-rc.1' into bastian/v1.9-port-v1.9.10-rc.1) + opcode.PrettyInstructionSetTypeIndex{ + IndexedType: sType, + IndexingType: aType, + }, // return value is s-copy opcode.PrettyInstructionTransferAndConvert{ ValueType: sType, @@ -11909,13 +11852,11 @@ func TestCompileAttachments(t *testing.T) { opcode.PrettyInstructionStatement{}, opcode.PrettyInstructionGetLocal{Local: sLocalIndex}, // access A on s: s[A], returns attachment reference as optional -<<<<<<< 8fd8bd4ab (Merge pull request #4440 from onflow/bastian/port-v1.9.9-rc.2) - opcode.PrettyInstructionGetTypeIndex{Type: aType}, + opcode.PrettyInstructionGetTypeIndex{ + IndexedType: sType, + IndexingType: aType, + }, opcode.PrettyInstructionSetLocal{ -======= - opcode.InstructionGetTypeIndex{IndexedType: 1, IndexingType: 3}, - opcode.InstructionSetLocal{ ->>>>>>> 7444244b7 (Merge tag 'v1.9.10-rc.1' into bastian/v1.9-port-v1.9.10-rc.1) Local: attachmentLocalIndex, IsTempVar: true, }, diff --git a/bbq/opcode/instructions.go b/bbq/opcode/instructions.go remerge CONFLICT (content): Merge conflict in bbq/opcode/instructions.go index b879801d7..484520355 100644 --- a/bbq/opcode/instructions.go +++ b/bbq/opcode/instructions.go @@ -577,7 +577,7 @@ func (i InstructionGetIndex) ResolvedOperandsString(sb *strings.Builder, program ProgramForInstructions, colorize bool) { sb.WriteByte(' ') - printfTypeArgument(sb, "indexedType", types[i.IndexedType], colorize) + printfTypeArgument(sb, "indexedType", program.GetTypes()[i.IndexedType], colorize) } func (i InstructionGetIndex) Encode(code *[]byte) { @@ -591,7 +591,9 @@ func DecodeGetIndex(ip *uint16, code []byte) (i InstructionGetIndex) { } func (i InstructionGetIndex) Pretty(program ProgramForInstructions) PrettyInstruction { - return PrettyInstructionGetIndex{} + return PrettyInstructionGetIndex{ + IndexedType: program.GetTypes()[i.IndexedType], + } } // InstructionRemoveIndex @@ -628,7 +630,7 @@ func (i InstructionRemoveIndex) ResolvedOperandsString(sb *strings.Builder, program ProgramForInstructions, colorize bool) { sb.WriteByte(' ') - printfTypeArgument(sb, "indexedType", types[i.IndexedType], colorize) + printfTypeArgument(sb, "indexedType", program.GetTypes()[i.IndexedType], colorize) sb.WriteByte(' ') printfArgument(sb, "pushPlaceholder", i.PushPlaceholder, colorize) } @@ -647,6 +649,7 @@ func DecodeRemoveIndex(ip *uint16, code []byte) (i InstructionRemoveIndex) { func (i InstructionRemoveIndex) Pretty(program ProgramForInstructions) PrettyInstruction { return PrettyInstructionRemoveIndex{ + IndexedType: program.GetTypes()[i.IndexedType], PushPlaceholder: i.PushPlaceholder, } } @@ -681,7 +684,7 @@ func (i InstructionSetIndex) ResolvedOperandsString(sb *strings.Builder, program ProgramForInstructions, colorize bool) { sb.WriteByte(' ') - printfTypeArgument(sb, "indexedType", types[i.IndexedType], colorize) + printfTypeArgument(sb, "indexedType", program.GetTypes()[i.IndexedType], colorize) } func (i InstructionSetIndex) Encode(code *[]byte) { @@ -695,7 +698,9 @@ func DecodeSetIndex(ip *uint16, code []byte) (i InstructionSetIndex) { } func (i InstructionSetIndex) Pretty(program ProgramForInstructions) PrettyInstruction { - return PrettyInstructionSetIndex{} + return PrettyInstructionSetIndex{ + IndexedType: program.GetTypes()[i.IndexedType], + } } // InstructionVoid @@ -3229,13 +3234,9 @@ func (i InstructionGetTypeIndex) ResolvedOperandsString(sb *strings.Builder, program ProgramForInstructions, colorize bool) { sb.WriteByte(' ') -<<<<<<< 8fd8bd4ab (Merge pull request #4440 from onflow/bastian/port-v1.9.9-rc.2) - printfTypeArgument(sb, "type", program.GetTypes()[i.Type], colorize) -======= - printfTypeArgument(sb, "indexedType", types[i.IndexedType], colorize) + printfTypeArgument(sb, "indexedType", program.GetTypes()[i.IndexedType], colorize) sb.WriteByte(' ') - printfTypeArgument(sb, "indexingType", types[i.IndexingType], colorize) ->>>>>>> 7444244b7 (Merge tag 'v1.9.10-rc.1' into bastian/v1.9-port-v1.9.10-rc.1) + printfTypeArgument(sb, "indexingType", program.GetTypes()[i.IndexingType], colorize) } func (i InstructionGetTypeIndex) Encode(code *[]byte) { @@ -3252,7 +3253,8 @@ func DecodeGetTypeIndex(ip *uint16, code []byte) (i InstructionGetTypeIndex) { func (i InstructionGetTypeIndex) Pretty(program ProgramForInstructions) PrettyInstruction { return PrettyInstructionGetTypeIndex{ - Type: program.GetTypes()[i.Type], + IndexedType: program.GetTypes()[i.IndexedType], + IndexingType: program.GetTypes()[i.IndexingType], } } @@ -3290,13 +3292,9 @@ func (i InstructionRemoveTypeIndex) ResolvedOperandsString(sb *strings.Builder, program ProgramForInstructions, colorize bool) { sb.WriteByte(' ') -<<<<<<< 8fd8bd4ab (Merge pull request #4440 from onflow/bastian/port-v1.9.9-rc.2) - printfTypeArgument(sb, "type", program.GetTypes()[i.Type], colorize) -======= - printfTypeArgument(sb, "indexedType", types[i.IndexedType], colorize) + printfTypeArgument(sb, "indexedType", program.GetTypes()[i.IndexedType], colorize) sb.WriteByte(' ') - printfTypeArgument(sb, "indexingType", types[i.IndexingType], colorize) ->>>>>>> 7444244b7 (Merge tag 'v1.9.10-rc.1' into bastian/v1.9-port-v1.9.10-rc.1) + printfTypeArgument(sb, "indexingType", program.GetTypes()[i.IndexingType], colorize) } func (i InstructionRemoveTypeIndex) Encode(code *[]byte) { @@ -3313,7 +3311,8 @@ func DecodeRemoveTypeIndex(ip *uint16, code []byte) (i InstructionRemoveTypeInde func (i InstructionRemoveTypeIndex) Pretty(program ProgramForInstructions) PrettyInstruction { return PrettyInstructionRemoveTypeIndex{ - Type: program.GetTypes()[i.Type], + IndexedType: program.GetTypes()[i.IndexedType], + IndexingType: program.GetTypes()[i.IndexingType], } } @@ -3350,13 +3349,9 @@ func (i InstructionSetTypeIndex) ResolvedOperandsString(sb *strings.Builder, program ProgramForInstructions, colorize bool) { sb.WriteByte(' ') -<<<<<<< 8fd8bd4ab (Merge pull request #4440 from onflow/bastian/port-v1.9.9-rc.2) - printfTypeArgument(sb, "type", program.GetTypes()[i.Type], colorize) -======= - printfTypeArgument(sb, "indexedType", types[i.IndexedType], colorize) + printfTypeArgument(sb, "indexedType", program.GetTypes()[i.IndexedType], colorize) sb.WriteByte(' ') - printfTypeArgument(sb, "indexingType", types[i.IndexingType], colorize) ->>>>>>> 7444244b7 (Merge tag 'v1.9.10-rc.1' into bastian/v1.9-port-v1.9.10-rc.1) + printfTypeArgument(sb, "indexingType", program.GetTypes()[i.IndexingType], colorize) } func (i InstructionSetTypeIndex) Encode(code *[]byte) { @@ -3373,7 +3368,8 @@ func DecodeSetTypeIndex(ip *uint16, code []byte) (i InstructionSetTypeIndex) { func (i InstructionSetTypeIndex) Pretty(program ProgramForInstructions) PrettyInstruction { return PrettyInstructionSetTypeIndex{ - Type: program.GetTypes()[i.Type], + IndexedType: program.GetTypes()[i.IndexedType], + IndexingType: program.GetTypes()[i.IndexingType], } } diff --git a/bbq/opcode/pretty_instructions.go b/bbq/opcode/pretty_instructions.go index 795d0ce82..09ae2f62a 100644 --- a/bbq/opcode/pretty_instructions.go +++ b/bbq/opcode/pretty_instructions.go @@ -265,6 +265,7 @@ func (i PrettyInstructionSetField) String() string { // Pops two values off the stack, the array and the index, // and then pushes the value at the given index of the array onto the stack. type PrettyInstructionGetIndex struct { + IndexedType interpreter.StaticType } var _ PrettyInstruction = PrettyInstructionGetIndex{} @@ -274,7 +275,11 @@ func (PrettyInstructionGetIndex) Opcode() Opcode { } func (i PrettyInstructionGetIndex) String() string { - return i.Opcode().String() + var sb strings.Builder + sb.WriteString(i.Opcode().String()) + sb.WriteByte(' ') + printfTypeArgument(&sb, "indexedType", i.IndexedType, false) + return sb.String() } // PrettyInstructionRemoveIndex @@ -284,6 +289,7 @@ func (i PrettyInstructionGetIndex) String() string { // Removes the value at the given index from the array and pushes it onto the stack. // If pushPlaceholder is true, also pushes the placeholder value that was inserted, if any, or nil otherwise. type PrettyInstructionRemoveIndex struct { + IndexedType interpreter.StaticType PushPlaceholder bool } @@ -297,6 +303,8 @@ func (i PrettyInstructionRemoveIndex) String() string { var sb strings.Builder sb.WriteString(i.Opcode().String()) sb.WriteByte(' ') + printfTypeArgument(&sb, "indexedType", i.IndexedType, false) + sb.WriteByte(' ') printfArgument(&sb, "pushPlaceholder", i.PushPlaceholder, false) return sb.String() } @@ -307,6 +315,7 @@ func (i PrettyInstructionRemoveIndex) String() string { // Pops three values off the stack, the array, the index, and the value, // and then sets the value at the given index of the array to the value. type PrettyInstructionSetIndex struct { + IndexedType interpreter.StaticType } var _ PrettyInstruction = PrettyInstructionSetIndex{} @@ -316,7 +325,11 @@ func (PrettyInstructionSetIndex) Opcode() Opcode { } func (i PrettyInstructionSetIndex) String() string { - return i.Opcode().String() + var sb strings.Builder + sb.WriteString(i.Opcode().String()) + sb.WriteByte(' ') + printfTypeArgument(&sb, "indexedType", i.IndexedType, false) + return sb.String() } // PrettyInstructionVoid @@ -1583,7 +1596,8 @@ func (i PrettyInstructionTemplateString) String() string { // Pops a value off the stack, the target, // and then pushes the value of the type key at the given index onto the stack. type PrettyInstructionGetTypeIndex struct { - Type interpreter.StaticType + IndexedType interpreter.StaticType + IndexingType interpreter.StaticType } var _ PrettyInstruction = PrettyInstructionGetTypeIndex{} @@ -1596,7 +1610,9 @@ func (i PrettyInstructionGetTypeIndex) String() string { var sb strings.Builder sb.WriteString(i.Opcode().String()) sb.WriteByte(' ') - printfTypeArgument(&sb, "type", i.Type, false) + printfTypeArgument(&sb, "indexedType", i.IndexedType, false) + sb.WriteByte(' ') + printfTypeArgument(&sb, "indexingType", i.IndexingType, false) return sb.String() } @@ -1607,7 +1623,8 @@ func (i PrettyInstructionGetTypeIndex) String() string { // Remove the value of the given type key from the target. // Additionally destroy if removed type is resource. type PrettyInstructionRemoveTypeIndex struct { - Type interpreter.StaticType + IndexedType interpreter.StaticType + IndexingType interpreter.StaticType } var _ PrettyInstruction = PrettyInstructionRemoveTypeIndex{} @@ -1620,7 +1637,9 @@ func (i PrettyInstructionRemoveTypeIndex) String() string { var sb strings.Builder sb.WriteString(i.Opcode().String()) sb.WriteByte(' ') - printfTypeArgument(&sb, "type", i.Type, false) + printfTypeArgument(&sb, "indexedType", i.IndexedType, false) + sb.WriteByte(' ') + printfTypeArgument(&sb, "indexingType", i.IndexingType, false) return sb.String() } @@ -1630,7 +1649,8 @@ func (i PrettyInstructionRemoveTypeIndex) String() string { // Pops two values off the stack, the target and the value, // and then sets the type key at the given index of the target to the value, and pushes it onto the stack. type PrettyInstructionSetTypeIndex struct { - Type interpreter.StaticType + IndexedType interpreter.StaticType + IndexingType interpreter.StaticType } var _ PrettyInstruction = PrettyInstructionSetTypeIndex{} @@ -1643,7 +1663,9 @@ func (i PrettyInstructionSetTypeIndex) String() string { var sb strings.Builder sb.WriteString(i.Opcode().String()) sb.WriteByte(' ') - printfTypeArgument(&sb, "type", i.Type, false) + printfTypeArgument(&sb, "indexedType", i.IndexedType, false) + sb.WriteByte(' ') + printfTypeArgument(&sb, "indexingType", i.IndexingType, false) return sb.String() }masterbranchFiles changedin the Github PR explorer