Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2001-03

bug in asm-block parser

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Matti Hamalainen

Found a (minor?) bug in FPC:

Double comment in ASM-block. Having two comments, other immendiately following the first one in an asm-block gets the compiler confused:

asm
      mov eax, 1;
      mov ebx, eax;
      { first comment }{ second comment }
      mov ecx, eax;
end;

If the comment-blocks are separated with a whitespace: {...} {...} the compiler works fine. Additionally, the bug only occurs within asm-blocks, inside Pascal-code it works ok.

Output log from FPC follows:

---clip---
Target OS: Linux for i386
Compiling tprog.pas
191 Kb Free
syslinux.pp(3,2) Hint: Conditional I386 was not set at startup in last compilation of syslinux.pp tprog.pas(11,26) Error: Unrecognized opcode SECOND tprog.pas(11,33) Error: Assembler syntax error
tprog.pas(11,41) Fatal: illegal character '}' ($7D) ---clip---

Same problem (naturally) with GO32v2/DOS version of FPC (1.0.4 too). Options: -vwenhil -Sgicm -Rintel

= ccr/TNSP - | http://www.tnsp.org/ =
= Foo is a synonym for Bar, but not vice versa. =