Quellcode durchsuchen

Fix for Mantis #25959.

* pdecsub.pas, parse_proc_direc:
    when a hint directive is parsed we need to check whether the new token can still be a directive

+ added test (though that won't help much as we don't check the compiler output yet... :/ )

git-svn-id: trunk@27463 -
svenbarth vor 11 Jahren
Ursprung
Commit
689996d84f
3 geänderte Dateien mit 21 neuen und 1 gelöschten Zeilen
  1. 1 0
      .gitattributes
  2. 7 1
      compiler/pdecsub.pas
  3. 13 0
      tests/webtbs/tw25959.pp

+ 1 - 0
.gitattributes

@@ -13890,6 +13890,7 @@ tests/webtbs/tw25895.pp svneol=native#text/pascal
 tests/webtbs/tw25929.pp svneol=native#text/pascal
 tests/webtbs/tw2594.pp svneol=native#text/plain
 tests/webtbs/tw2595.pp svneol=native#text/plain
+tests/webtbs/tw25959.pp svneol=native#text/pascal
 tests/webtbs/tw2602.pp svneol=native#text/plain
 tests/webtbs/tw2607.pp svneol=native#text/plain
 tests/webtbs/tw2620.pp svneol=native#text/plain

+ 7 - 1
compiler/pdecsub.pas

@@ -2503,7 +2503,13 @@ const
              _EXPERIMENTAL,
              _DEPRECATED :
                if (m_delphi in current_settings.modeswitches) and (pd.typ=procdef) then
-                 maybe_parse_hint_directives(tprocdef(pd))
+                 begin
+                   maybe_parse_hint_directives(tprocdef(pd));
+                   { could the new token still be a directive? }
+                   if token<>_ID then
+                     exit;
+                   name:=tokeninfo^[idtoken].str;
+                 end
                else
                  exit;
            end;

+ 13 - 0
tests/webtbs/tw25959.pp

@@ -0,0 +1,13 @@
+{ %NORUN }
+
+program tw25959;
+
+{$mode delphi}
+procedure test; deprecated;
+begin
+
+end;
+
+begin
+  test;
+end.