From af7846c278849e8778285ff38a1702399d3c8aa0 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Tue, 6 Sep 2016 22:31:12 -0700 Subject: [PATCH] script: removeData should not throw on reencoding of bad pushes. --- lib/script/script.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/script/script.js b/lib/script/script.js index 2a02bbe3..012273a7 100644 --- a/lib/script/script.js +++ b/lib/script/script.js @@ -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;