2
0
Эх сурвалжийг харах

volatile: allow for assignments

Jonas Maebe 2 жил өмнө
parent
commit
13346a42bc

+ 1 - 1
compiler/htypechk.pas

@@ -1869,7 +1869,7 @@ implementation
                begin
                  if ((valid_const in opts) and
                      (tinlinenode(hp).inlinenumber in [in_typeof_x])) or
-                    (tinlinenode(hp).inlinenumber in [in_unaligned_x,in_aligned_x]) then
+                    (tinlinenode(hp).inlinenumber in [in_unaligned_x,in_aligned_x,in_volatile_x]) then
                    result:=true
                  else
                    if report_errors then

+ 7 - 0
tests/tbs/tb0706.pp

@@ -0,0 +1,7 @@
+{ %norun }
+
+var
+  l: longint;
+begin
+  volatile(l) := 1;
+end.