Răsfoiți Sursa

core/asm: accept uppercase instructions (#16531)

dm4 7 ani în urmă
părinte
comite
c514fbccc0
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 2 2
      core/asm/compiler.go

+ 2 - 2
core/asm/compiler.go

@@ -236,12 +236,12 @@ func (c *Compiler) pushBin(v interface{}) {
 // isPush returns whether the string op is either any of
 // push(N).
 func isPush(op string) bool {
-	return op == "push"
+	return strings.ToUpper(op) == "PUSH"
 }
 
 // isJump returns whether the string op is jump(i)
 func isJump(op string) bool {
-	return op == "jumpi" || op == "jump"
+	return strings.ToUpper(op) == "JUMPI" || strings.ToUpper(op) == "JUMP"
 }
 
 // toBinary converts text to a vm.OpCode