From 56af8e86e3e00d8417838f582221e60e1d5f5fdb Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 2 Mar 2010 20:09:12 +0000 Subject: [PATCH] * Protect the `true', `false' and `__overrides' constants. Without an ATprotect call, these could be garbage collected, leading to weird crashes or wrong results. --- src/aterm-helper.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/aterm-helper.pl b/src/aterm-helper.pl index 9b2bde700..f1eb77ee8 100755 --- a/src/aterm-helper.pl +++ b/src/aterm-helper.pl @@ -146,8 +146,9 @@ while () { my $value = $2; print HEADER "extern ATerm $name;\n"; print IMPL "ATerm $name = 0;\n"; - $init .= " $name = $value;\n"; - } + $init .= " $name = $value;\n"; + $init .= " ATprotect(&$name);\n"; + } elsif (/^\s*init\s+(\w+)\s*$/) { $initFun = $1;