From 391f85f8287c3a1459114035d8a5bc3d4cecf83c Mon Sep 17 00:00:00 2001 From: nickysn Date: Thu, 8 Feb 2018 16:54:33 +0000 Subject: [PATCH] + for TP7 compatibility, allow the '&', '$' and '?' characters in the x86 intel syntax inline asm reader git-svn-id: trunk@38167 - --- .gitattributes | 1 + compiler/x86/rax86int.pas | 6 ++++-- tests/test/tuglylabels1.pp | 23 +++++++++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 tests/test/tuglylabels1.pp diff --git a/.gitattributes b/.gitattributes index 65c8373f2e..a64ed05146 100644 --- a/.gitattributes +++ b/.gitattributes @@ -13641,6 +13641,7 @@ tests/test/tudots.dot.prog.pp svneol=native#text/pascal tests/test/tudots.pp svneol=native#text/pascal tests/test/tudots.prog.pp svneol=native#text/pascal tests/test/tudots.test.pp svneol=native#text/pascal +tests/test/tuglylabels1.pp svneol=native#text/plain tests/test/tunaligned1.pp svneol=native#text/plain tests/test/tunistr1.pp svneol=native#text/plain tests/test/tunistr2.pp svneol=native#text/plain diff --git a/compiler/x86/rax86int.pas b/compiler/x86/rax86int.pas index 06e67f0a06..d35ab3fde5 100644 --- a/compiler/x86/rax86int.pas +++ b/compiler/x86/rax86int.pas @@ -275,7 +275,9 @@ Unit Rax86int; begin firsttoken:=FALSE; len:=0; - while c in ['A'..'Z','a'..'z','0'..'9','_','@'] do + while (c in ['A'..'Z','a'..'z','0'..'9','_','@']) or + { TP7 also allows $&? characters in local labels } + (forcelabel and (c in ['$','&','?'])) do begin { if there is an at_sign, then this must absolutely be a label } if c = '@' then @@ -328,7 +330,7 @@ Unit Rax86int; begin actasmpattern:=c; c:=current_scanner.asmgetchar; - while c in ['A'..'Z','a'..'z','0'..'9','_','@'] do + while c in ['A'..'Z','a'..'z','0'..'9','_','@','$','&','?'] do begin actasmpattern:=actasmpattern + c; c:=current_scanner.asmgetchar; diff --git a/tests/test/tuglylabels1.pp b/tests/test/tuglylabels1.pp new file mode 100644 index 0000000000..19e76d4d46 --- /dev/null +++ b/tests/test/tuglylabels1.pp @@ -0,0 +1,23 @@ +{ %NORUN } +{ %CPU=i8086,i386,x86_64 } +program tuglylabels1; + +{ This test is TP7 compatible } + +{$ifdef FPC} + {$asmmode intel} +{$endif FPC} + +{ allowed characters in a local label: + @$&_?abcdefghijklmnopqrstuvwxyz0123456789 } + +begin + asm +@: + jmp @ +@@: + jmp @@ +@$&_?@9: + jmp @$&_?@9 + end; +end.