From: John Ellson Date: Fri, 1 Nov 2013 20:22:15 +0000 (-0400) Subject: apply patch-lib__vmalloc__features__vmalloc-dyld-uses-malloc.diff (from ryandesign) X-Git-Tag: 2.38.0~216^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5904458c245a64e61eea8bf2dcd7bfbdefab5500;p=graphviz apply patch-lib__vmalloc__features__vmalloc-dyld-uses-malloc.diff (from ryandesign) --- diff --git a/lib/vmalloc/features/vmalloc b/lib/vmalloc/features/vmalloc index 5d632c6e0..1512a1e27 100644 --- a/lib/vmalloc/features/vmalloc +++ b/lib/vmalloc/features/vmalloc @@ -44,16 +44,23 @@ mal alloca note{ alloca is based on malloc() }end execute{ #if _hdr_alloca #include #endif + #include + volatile int testing_alloca = 0; #if _STD_ void* malloc(unsigned int size) #else void* malloc(size) unsigned int size; #endif - { exit(0); + { if (!testing_alloca) { + return ((void *(*)(unsigned int)) dlsym(RTLD_NEXT, "malloc"))(size); + } + exit(0); return 0; } main() - { alloca(10); + { testing_alloca = 1; + alloca(10); + testing_alloca = 0; return 1; } }end