use ashr from nim-stint/#76
This commit is contained in:
parent
51e23fa582
commit
929b28b133
|
@ -906,19 +906,14 @@ op shrOp, inline = true, shift, num:
|
||||||
|
|
||||||
op sarOp, inline = true:
|
op sarOp, inline = true:
|
||||||
let shiftLen = computation.stack.popInt().safeInt
|
let shiftLen = computation.stack.popInt().safeInt
|
||||||
let x = computation.stack.popInt()
|
let num = cast[Int256](computation.stack.popInt())
|
||||||
#let num = cast[Int256](computation.stack.popInt())
|
|
||||||
if shiftLen >= 256:
|
if shiftLen >= 256:
|
||||||
#if num.isNegative:
|
if num.isNegative:
|
||||||
if cast[Int256](x).isNegative:
|
|
||||||
push: cast[Uint256]((-1).i256)
|
push: cast[Uint256]((-1).i256)
|
||||||
else:
|
else:
|
||||||
push: 0
|
push: 0
|
||||||
else:
|
else:
|
||||||
# ashr depends on nim-stint/#76
|
push: cast[Uint256](ashr(num, shiftLen))
|
||||||
# push: cast[Uint256](ashr(num, shiftLen))
|
|
||||||
# while waiting for stint/#76 merged, we use this workaround
|
|
||||||
push: (x shr shiftLen) or (((0-(x shr 255)) shl 1) shl (255-shiftLen))
|
|
||||||
|
|
||||||
op extCodeHash, inline = true:
|
op extCodeHash, inline = true:
|
||||||
let address = computation.stack.popAddress()
|
let address = computation.stack.popAddress()
|
||||||
|
|
Loading…
Reference in New Issue