Skip to content

Commit

Permalink
Fixes #72
Browse files Browse the repository at this point in the history
FossilOrigin-Name: 5b5cf6faceffe02ae99a15b2ccff4977f605b7f1d091c3d5605294934be6e9b7
  • Loading branch information
pmacdona committed Dec 27, 2021
1 parent 8d57b65 commit 95baccf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/jsiRegexp.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ static Jsi_RC RegexpExecCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_thi
Jsi_Number lv = 0;
if (isglob) {
l = Jsi_ValueObjLookup(interp, v, "lastIndex", 0);
if (l && Jsi_ValueGetNumber(interp, l, &lv) != JSI_OK)
if (l && (Jsi_ValueGetNumber(interp, l, &lv) != JSI_OK || !Jsi_NumberIsNormal(lv)))
return Jsi_LogError("lastIndex not a number");
if (l)
re->lastIndex = (int)lv;
Expand Down

0 comments on commit 95baccf

Please sign in to comment.