wazevo(ssa): resets nextVariable (#1834)

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
This commit is contained in:
Takeshi Yoneda
2023-11-13 09:43:45 +09:00
committed by GitHub
parent 9bc1ae6816
commit 2d760b400f
2 changed files with 2 additions and 5 deletions

View File

@@ -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()
@@ -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)

View File

@@ -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.