Skip to content

Instantly share code, notes, and snippets.

@mattn
Created April 16, 2015 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattn/72b4db631191c52b5d42 to your computer and use it in GitHub Desktop.
Save mattn/72b4db631191c52b5d42 to your computer and use it in GitHub Desktop.
diff --git a/cop.h b/cop.h
index ce0cd54..f953991 100644
--- a/cop.h
+++ b/cop.h
@@ -1111,7 +1111,8 @@ typedef struct stackinfo PERL_SI;
#define PUSHSTACKi(type) \
STMT_START { \
- PERL_SI *next = PL_curstackinfo->si_next; \
+ PERL_SI *next = PL_curstackinfo ? \
+ PL_curstackinfo->si_next : NULL; \
DEBUG_l({ \
int i = 0; PERL_SI *p = PL_curstackinfo; \
while (p) { i++; p = p->si_prev; } \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment