In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/c62df97fd6a0ef53562060054f04dfeadb67f5f8?hp=cf34c81f6b96c70e2ecf357bbaf3b28eb58272c4>
- Log ----------------------------------------------------------------- commit c62df97fd6a0ef53562060054f04dfeadb67f5f8 Author: Father Chrysostomos <[email protected]> Date: Sat Nov 15 09:31:46 2014 -0800 Revert the âreturnâ part of 6edcbed6 The gotos were jumping over initializations, causing C+++threads+debugging to fail. ----------------------------------------------------------------------- Summary of changes: util.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/util.c b/util.c index 4ee17c2..49faf9b 100644 --- a/util.c +++ b/util.c @@ -172,17 +172,14 @@ Perl_safesysmalloc(MEM_SIZE size) #endif ptr = (Malloc_t)((char*)ptr+PERL_MEMORY_DEBUG_HEADER_SIZE); DEBUG_m(PerlIO_printf(Perl_debug_log, "0x%"UVxf": (%05ld) malloc %ld bytes\n",PTR2UV(ptr),(long)PL_an++,(long)size)); - ret: return ptr; } else { #ifndef ALWAYS_NEED_THX dTHX; #endif - if (PL_nomemok){ - ptr = NULL; - goto ret; - } + if (PL_nomemok) + return NULL; else { croak_no_mem(); } @@ -210,14 +207,11 @@ Perl_safesysrealloc(Malloc_t where,MEM_SIZE size) if (!size) { safesysfree(where); - ptr = NULL; - goto ret; + return NULL; } - if (!where) { - ptr = safesysmalloc(size); - goto ret; - } + if (!where) + return safesysmalloc(size); #ifdef USE_MDH where = (Malloc_t)((char*)where-PERL_MEMORY_DEBUG_HEADER_SIZE); size += PERL_MEMORY_DEBUG_HEADER_SIZE; @@ -299,17 +293,14 @@ Perl_safesysrealloc(Malloc_t where,MEM_SIZE size) if (ptr != NULL) { - ret: return ptr; } else { #ifndef ALWAYS_NEED_THX dTHX; #endif - if (PL_nomemok){ - ptr = NULL; - goto ret; - } + if (PL_nomemok) + return NULL; else { croak_no_mem(); } -- Perl5 Master Repository
