Skip to content

Commit

Permalink
wazevo(ssa): resets nextVariable (#1834)
Browse files Browse the repository at this point in the history
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
  • Loading branch information
mathetake authored Nov 13, 2023
1 parent 9bc1ae6 commit 2d760b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions internal/engine/wazevo/ssa/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ func (b *builder) ReturnBlock() BasicBlock {

// Init implements Builder.Reset.
func (b *builder) Init(s *Signature) {
b.nextVariable = 0
b.currentSignature = s
resetBasicBlock(b.returnBlk)
b.instructionsPool.Reset()
Expand All @@ -222,10 +223,6 @@ func (b *builder) Init(s *Signature) {
}
b.basicBlocksPool.Reset()

for i := Variable(0); i < b.nextVariable; i++ {
b.variables[i] = typeInvalid
}

for v := ValueID(0); v < b.nextValueID; v++ {
delete(b.valueAnnotations, v)
delete(b.valueIDAliases, v)
Expand Down
2 changes: 1 addition & 1 deletion internal/engine/wazevo/ssa/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package ssa
type Type byte

const (
typeInvalid Type = 1 + iota
typeInvalid Type = iota

// TODO: add 8, 16 bit types when it's needed for optimizations.

Expand Down

0 comments on commit 2d760b4

Please sign in to comment.