summaryrefslogtreecommitdiffhomepage
path: root/src/cregex.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cregex.c')
-rw-r--r--src/cregex.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cregex.c b/src/cregex.c
index def759ee..7789ee6e 100644
--- a/src/cregex.c
+++ b/src/cregex.c
@@ -570,7 +570,8 @@ _optimize(_Parser *par, _Reprog *pp)
cl->end = (_Rune *)((char*)cl->end + diff);
break;
}
- inst->l.left = (_Reinst *)((char*)inst->l.left + diff);
+ if (inst->l.left)
+ inst->l.left = (_Reinst *)((char*)inst->l.left + diff);
}
npp->startinst = (_Reinst *)((char*)npp->startinst + diff);
return npp;