summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-11-15 09:31:46 -0800
committerFather Chrysostomos <sprout@cpan.org>2014-11-15 09:44:07 -0800
commitc62df97fd6a0ef53562060054f04dfeadb67f5f8 (patch)
treea861a2a80a26ee7b249b1906a4d75cfe04a5acd0 /util.c
parentcf34c81f6b96c70e2ecf357bbaf3b28eb58272c4 (diff)
downloadperl-c62df97fd6a0ef53562060054f04dfeadb67f5f8.tar.gz
Revert the ‘return’ part of 6edcbed6
The gotos were jumping over initializations, causing C+++threads+debugging to fail.
Diffstat (limited to 'util.c')
-rw-r--r--util.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/util.c b/util.c
index 4ee17c2a44..49faf9bb13 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();
}