From c9a0b2a8182abcb87afa1d8766d74ca8fa87cb34 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Mon, 2 Oct 2017 21:20:47 +0300 Subject: [PATCH] extmod/re1.5: Upgrade to v0.8.2, adds hook for stack overflow checking. --- extmod/re1.5/re1.5.h | 3 +++ extmod/re1.5/recursiveloop.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/extmod/re1.5/re1.5.h b/extmod/re1.5/re1.5.h index 815c5d33d..ba6f97b74 100644 --- a/extmod/re1.5/re1.5.h +++ b/extmod/re1.5/re1.5.h @@ -48,6 +48,9 @@ void printre(Regexp*); #ifndef re1_5_fatal void re1_5_fatal(char*); #endif +#ifndef re1_5_stack_chk +#define re1_5_stack_chk() +#endif void *mal(int); struct Prog diff --git a/extmod/re1.5/recursiveloop.c b/extmod/re1.5/recursiveloop.c index e8fef0304..bb337decf 100644 --- a/extmod/re1.5/recursiveloop.c +++ b/extmod/re1.5/recursiveloop.c @@ -9,7 +9,9 @@ recursiveloop(char *pc, const char *sp, Subject *input, const char **subp, int n { const char *old; int off; - + + re1_5_stack_chk(); + for(;;) { if(inst_is_consumer(*pc)) { // If we need to match a character, but there's none left, it's fail