author | Alberto Bertogli
<albertito@blitiri.com.ar> 2012-09-04 23:44:51 UTC |
committer | Alberto Bertogli
<albertito@blitiri.com.ar> 2012-09-04 23:48:23 UTC |
parent | 2be43a71b7e32dcd0489ee70667aa0898a9f645a |
libfiu/fiu.c | +6 | -0 |
diff --git a/libfiu/fiu.c b/libfiu/fiu.c index d9ea787..68cab04 100644 --- a/libfiu/fiu.c +++ b/libfiu/fiu.c @@ -540,6 +540,12 @@ int fiu_enable_stack_by_name(const char *name, int failnum, void *failinfo, { void *fp; + /* We need to check this here instead of relying on the test within + * fiu_enable_stack() in case it is inlined; that would fail the check + * because fiu_enable_stack() would not be in the stack. */ + if (backtrace_works((void (*)()) fiu_enable_stack_by_name) == 0) + return -1; + fp = get_func_addr(func_name); if (fp == NULL) return -1;