Go to the first, previous, next, last section, table of contents.


initialize_static_variable

static 変数の初期化の問題点. 初期化の時に segmentation fault がおきる.
if (1) {
 module abc;
 static A;
 A=1;
 endmodule;
} else { };

end$
を t.rr とするとき, 

[6] load("./t.rr");
1
internal error (SEGV)
となる.

t.rr を
if (1) {
 module abc;
 static A;
 localf initA;
 localf foo;
 def initA() {
   A=1;
 }
 initA();
 def foo() {
   return A;
 }
 endmodule;
} else { };

end$
とすると正しく初期化される.

ChangeLog


Go to the first, previous, next, last section, table of contents.