Peter N Lewis wrote:
At 12:35 +0800 27/6/05, Peter N Lewis wrote:
The following program (with an error in it) crashes the compiler. The error (BSET undeclared) is detected, but then the compiler crashes trying to bail out.
Looks like there is either two bugs, or the above is related to the internal compiler error generated from the program below for assigning an object method return value. Peter.
The following patch fixed both crashes for me:
diff -u p.nn/statements.c p/statements.c --- p.nn/statements.c 2005-03-31 01:57:24.000000000 +0200 +++ p/statements.c 2005-06-27 23:19:47.906825912 +0200 @@ -1113,8 +1113,12 @@ if (CALL_METHOD (target)) { tree method_name = DECL_NAME (TREE_OPERAND (target, 1)); + tree op0 = TREE_OPERAND (target, 0); + tree t = TREE_TYPE (op0); + if (TYPE_POINTER_TO (t) && PASCAL_TYPE_CLASS (TYPE_POINTER_TO (t))) + t = TYPE_POINTER_TO (t); target = lookup_name (get_method_name ( - DECL_NAME (TYPE_NAME (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (target, 0))))), method_name)); + DECL_NAME (TYPE_NAME (TYPE_MAIN_VARIANT (t))), method_name)); if (!target) { error ("result of method `%s' assigned outside its block", IDENTIFIER_NAME (method_name));