projects
/
libfirm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8674967
)
Fix bug with panic("out of memory")
author
Andreas Zwinkau
<zwinkau@kit.edu>
Mon, 9 Jan 2012 15:39:07 +0000
(16:39 +0100)
committer
Andreas Zwinkau
<zwinkau@kit.edu>
Mon, 9 Jan 2012 15:42:15 +0000
(16:42 +0100)
The panic function might allocate memory via ir_vfprintf, so we must
not use it in the out of memory case. Otherwise we get an infinite loop.
ir/adt/xmalloc.c
patch
|
blob
|
history
diff --git
a/ir/adt/xmalloc.c
b/ir/adt/xmalloc.c
index
12f2237
..
4f2ba33
100644
(file)
--- a/
ir/adt/xmalloc.c
+++ b/
ir/adt/xmalloc.c
@@
-35,7
+35,8
@@
static NORETURN xnomem(void)
{
- panic("out of memory");
+ /* Do not use panic() here, because it might try to allocate memory! */
+ fputs("out of memory", stderr);
}
void *xmalloc(size_t size)