script: removeData should not throw on reencoding of bad pushes.

This commit is contained in:
Christopher Jeffrey 2016-09-06 22:31:12 -07:00
parent b0d7fc14b1
commit af7846c278
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -1259,8 +1259,11 @@ Script.prototype.removeData = function removeData(data) {
for (i = 0; i < this.code.length; i++) {
op = this.code[i];
if (op.value === -1)
if (op.value === -1) {
if (index.length > 0)
index.push(i);
break;
}
if (!op.data)
continue;