Browse Source

do not allow extern non-inline variables to be initialized (fixed issue #1338)

Simon Krajewski 12 years ago
parent
commit
929e3b35ca
1 changed files with 3 additions and 0 deletions
  1. 3 0
      typeload.ml

+ 3 - 0
typeload.ml

@@ -1137,6 +1137,9 @@ let init_class ctx c p context_init herits fields =
 						if not stat then begin
 							display_error ctx "Extern non-static variables may not be initialized" p;
 							e
+						end else if v.v_read <> AccInline then begin
+							display_error ctx "Extern non-inline variables may not be initialized" p;
+							e
 						end else begin
 							match make_const e with
 							| Some e -> e