mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-01-02 04:31:25 +00:00
Fix bug with assembly-language functions that return structs/unions.
This commit is contained in:
parent
f567d60429
commit
daede21819
24
Parser.pas
24
Parser.pas
@ -3859,24 +3859,24 @@ if isFunction then begin
|
||||
lp := lp^.pnext;
|
||||
end; {while}
|
||||
gotoList := nil; {initialize the label list}
|
||||
{set up struct/union area}
|
||||
if variable^.itype^.ftype^.kind in [structType,unionType] then begin
|
||||
lp := NewSymbol(@'@struct', variable^.itype^.ftype, staticsy,
|
||||
variablespace, declared);
|
||||
tk.kind := ident;
|
||||
tk.class := identifier;
|
||||
tk.name := @'@struct';
|
||||
tk.symbolPtr := nil;
|
||||
lp := FindSymbol(tk, variableSpace, false, true);
|
||||
Gen1Name(pc_lao, 0, lp^.name);
|
||||
Gen2t(pc_str, 0, 0, cgULong);
|
||||
end; {if}
|
||||
fenvAccessInFunction := fenvAccess;
|
||||
if isAsm then begin
|
||||
AsmFunction(variable); {handle assembly language functions}
|
||||
PopTable;
|
||||
end {if}
|
||||
else begin
|
||||
{set up struct/union area}
|
||||
if variable^.itype^.ftype^.kind in [structType,unionType] then begin
|
||||
lp := NewSymbol(@'@struct', variable^.itype^.ftype, staticsy,
|
||||
variablespace, declared);
|
||||
tk.kind := ident;
|
||||
tk.class := identifier;
|
||||
tk.name := @'@struct';
|
||||
tk.symbolPtr := nil;
|
||||
lp := FindSymbol(tk, variableSpace, false, true);
|
||||
Gen1Name(pc_lao, 0, lp^.name);
|
||||
Gen2t(pc_str, 0, 0, cgULong);
|
||||
end; {if}
|
||||
{generate parameter labels}
|
||||
if fnType^.overrideKR then
|
||||
GenParameters(nil)
|
||||
|
2
cc.notes
2
cc.notes
@ -1376,6 +1376,8 @@ int foo(int[42]);
|
||||
|
||||
168. Unions may now contain bit-fields, as specified in the C standards.
|
||||
|
||||
169. If an assembly-language function (declared with the asm keyword) had a structure or union return type, ORCA/C would generate some spurious code at the beginning of the function, which might trash data used by its caller.
|
||||
|
||||
-- Bugs from C 2.1.0 that have been fixed -----------------------------------
|
||||
|
||||
1. In some situations, fread() reread the first 1K or so of the file.
|
||||
|
Loading…
Reference in New Issue
Block a user