Skip to content

Commit

Permalink
yet another SIGNEXTEND fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cdetrio committed Jun 18, 2017
1 parent a90b936 commit 9e9cc01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/opFns.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ module.exports = {
},
SIGNEXTEND: function (k, val, runState) {
k = new BN(k)
val = new Buffer(val) // use clone, don't modify object reference
var extendOnes = false

if (k.cmpn(31) <= 0) {
Expand All @@ -146,7 +147,6 @@ module.exports = {
for (var i = 30 - k; i >= 0; i--) {
val[i] = extendOnes ? 0xff : 0
}

}

return val
Expand Down

0 comments on commit 9e9cc01

Please sign in to comment.