Michelson: make maximum integer for gas 32 bit compatible (#169)
This commit is contained in:
parent
2d9bbcce90
commit
2fbc60af75
@ -232,18 +232,20 @@ module Cost_of = struct
|
|||||||
| None -> default
|
| None -> default
|
||||||
| Some x -> x
|
| Some x -> x
|
||||||
|
|
||||||
|
let max_int = 1073741823
|
||||||
|
|
||||||
let shift_left x y =
|
let shift_left x y =
|
||||||
(alloc_cost @@ words_of_bits @@
|
(alloc_cost @@ words_of_bits @@
|
||||||
let (+) = Pervasives.(+) in
|
let (+) = Pervasives.(+) in
|
||||||
Z.numbits (Script_int.to_zint x) +
|
Z.numbits (Script_int.to_zint x) +
|
||||||
(unopt (Script_int.to_int y) ~default:2147483647))
|
(unopt (Script_int.to_int y) ~default:max_int))
|
||||||
|
|
||||||
let shift_right x y =
|
let shift_right x y =
|
||||||
(alloc_cost @@ words_of_bits @@
|
(alloc_cost @@ words_of_bits @@
|
||||||
max 1 @@
|
max 1 @@
|
||||||
let (-) = Pervasives.(-) in
|
let (-) = Pervasives.(-) in
|
||||||
Z.numbits (Script_int.to_zint x) -
|
Z.numbits (Script_int.to_zint x) -
|
||||||
unopt (Script_int.to_int y) ~default:2147483647)
|
unopt (Script_int.to_int y) ~default:max_int)
|
||||||
|
|
||||||
|
|
||||||
let exec = step_cost 1
|
let exec = step_cost 1
|
||||||
|
Loading…
Reference in New Issue
Block a user