Disallow mistyped expressions for the function in function calls.

Previously, the code would remove any number of "pointer to" and "array of" elements in the type, and accept it if this ultimately yielded a function type. Thus, the expressions denoting the function to be called could be, e.g., a pointer to a function pointer or an array of function pointers. The code generated in these cases would not work properly, but no error was reported.

Now only function pointers or expressions of function type are accepted, as they should be.
This commit is contained in:
Stephen Heumann committed 2026-02-08 18:17:35 -06:00
1 parent 9fffb51b96
commit ca5a93e974
1 file changed
+1 -1
+1 -1
View File
@@ -3733,7 +3733,7 @@ var
doDispose := ldoDispose;
codeGeneration := lCodeGeneration and (numErrors = 0);
ftype := expressionType;
while ftype^.kind in [pointerType,arrayType] do
if ftype^.kind = pointerType then
ftype := ftype^.ptype;
end; {if}