@@ -747,7 +747,10 @@ func assembleBranch(ops *OpStream, spec *OpSpec, args []string) error {
747747}
748748
749749func assembleSubstring (ops * OpStream , spec * OpSpec , args []string ) error {
750- asmDefault (ops , spec , args )
750+ err := asmDefault (ops , spec , args )
751+ if err != nil {
752+ return err
753+ }
751754 // Having run asmDefault, only need to check extra constraints.
752755 start , _ := strconv .ParseUint (args [0 ], 0 , 64 )
753756 end , _ := strconv .ParseUint (args [1 ], 0 , 64 )
@@ -1010,7 +1013,7 @@ type assembleFunc func(*OpStream, *OpSpec, []string) error
10101013// Basic assembly. Any extra bytes of opcode are encoded as byte immediates.
10111014func asmDefault (ops * OpStream , spec * OpSpec , args []string ) error {
10121015 if len (args ) != spec .Details .Size - 1 {
1013- ops .errorf ("%s expects %d immediate arguments" , spec .Name , spec .Details .Size - 1 )
1016+ return ops .errorf ("%s expects %d immediate arguments" , spec .Name , spec .Details .Size - 1 )
10141017 }
10151018 ops .pending .WriteByte (spec .Opcode )
10161019 for i := 0 ; i < spec .Details .Size - 1 ; i ++ {
0 commit comments