projects
/
libfirm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8331be5
)
An ir_node may be even smaller than a struct ir_node, so make right copy
author
Michael Beck
<beck@ipd.info.uni-karlsruhe.de>
Thu, 24 Jun 2004 15:03:29 +0000
(15:03 +0000)
committer
Michael Beck
<beck@ipd.info.uni-karlsruhe.de>
Thu, 24 Jun 2004 15:03:29 +0000
(15:03 +0000)
to shut up valgrind (and prevend possible segfaults)
[r3206]
ir/ir/iropt.c
patch
|
blob
|
history
diff --git
a/ir/ir/iropt.c
b/ir/ir/iropt.c
index
ce0e569
..
a606677
100644
(file)
--- a/
ir/ir/iropt.c
+++ b/
ir/ir/iropt.c
@@
-1568,8
+1568,12
@@
optimize_node (ir_node *n)
* we MUST copy the node here temparary, because it's still needed
* for DBG_OPT_ALGSIM0
*/
- ir_node x = *n;
- oldn = &x;
+ int node_size = offsetof(ir_node, attr) + n->op->attr_size;
+ ir_node *x = alloca(node_size);
+
+ memcpy(x, n, node_size);
+ oldn = x;
+
/* evaluation was successful -- replace the node. */
obstack_free (current_ir_graph->obst, n);
n = new_Const (get_tarval_mode (tv), tv);