Hex and binary literal support in hex
This commit is contained in:
@@ -106,14 +106,14 @@ func assembleOperand(op string, t operandType) (*vm.Operand, error) {
|
||||
|
||||
switch {
|
||||
case t == s || (t == us && (strings.HasPrefix(numStr, "+") || strings.HasPrefix(numStr, "-"))):
|
||||
num, err := strconv.ParseInt(numStr, 10, 64)
|
||||
num, err := strconv.ParseInt(numStr, 0, 64)
|
||||
if err != nil {
|
||||
return ret, errors.Wrapf(err, "While parsing operand value %s", numStr)
|
||||
}
|
||||
ret.Value = uint64(num)
|
||||
|
||||
case t == u || t == us || t == r:
|
||||
num, err := strconv.ParseUint(numStr, 10, 64)
|
||||
num, err := strconv.ParseUint(numStr, 0, 64)
|
||||
if err != nil {
|
||||
return ret, errors.Wrapf(err, "While parsing operand value %s", numStr)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user