While helping someone port a MacPascal Object Pascal program to GPC, an internal compiler error was encountered when an object method heading signature type declaration didn't match the method implementation's heading signature. A distilled down test program that reproduces the internal compiler error:
{$mac-objects}
program MethodParameterMismatchBug;
type UInt8 = Byte; Str255 = record sLength: UInt8; sChars: packed array[1..255] of char; end;
xButton = object procedure SetUp (name: Str255); end;
procedure xButton.Setup(name: string); {WRONG} begin end;
begin end.
When you compile it with "gpc -c MethodParameterMismatchBug.pas", you get:
MethodParameterMismatchBug.pas:17: internal compiler error: Bus error Please submit a full bug report, with preprocessed source if appropriate. See URL:http://www.gnu-pascal.de/todo.html for instructions.
The GPC used for compiling is the Mac OS X GPC that Adriaan is distributing from his web site. The specs are:
Reading specs from /Developer/Pascal/gpc345u2/lib/gcc/powerpc-apple-darwin8/3.4.5/specs Configured with: ../gcc-3.4.5/configure --enable-languages=pascal,c --enable-threads=posix --target=powerpc-apple-darwin8 --host=powerpc-apple-darwin8 --build=powerpc-apple-darwin8 --prefix=/Developer/Pascal/gpc345u2 Thread model: posix gpc version 20051116, based on gcc-3.4.5
It is obvious in this test program's small context that the parameter types are different between the declared method heading and the implementation method heading so the compiler should find an error since the two signatures don't match exactly. However, the error shouldn't be an internal compiler error.
I'll mention there was a duplication of that parameter type mismatch with another object type's method heading in a larger code context that resulted in an error message something like the compiler was too confused to continue. However, I can't reproduce it with a small test program.
Gale Paeper gpaeper@empirenet.com