summaryrefslogtreecommitdiffstats
path: root/generic/tclOptimize.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclOptimize.c')
-rw-r--r--generic/tclOptimize.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/generic/tclOptimize.c b/generic/tclOptimize.c
index cd37a6a..b7f4173 100644
--- a/generic/tclOptimize.c
+++ b/generic/tclOptimize.c
@@ -212,7 +212,8 @@ ConvertZeroEffectToNOP(
int blank = 0, i, nextInst;
size = AddrLength(currentInstPtr);
- while (*(currentInstPtr+size) == INST_NOP) {
+ while ((currentInstPtr + size < envPtr->codeNext)
+ && *(currentInstPtr+size) == INST_NOP) {
if (IsTargetAddress(&targets, currentInstPtr + size)) {
break;
}