Skip to content

Commit

Permalink
C/LLVM backends: Don't emit fake dynamic array fields (only descriptors)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkl committed Mar 19, 2014
1 parent 86e2409 commit 88412ea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/compiler/ir-hlc.bas
Expand Up @@ -981,7 +981,8 @@ private sub hEmitStruct _
if( symbFieldIsBitfield( fld ) ) then
skip = (fld->var_.bitpos <> 0)
else
skip = FALSE
'' Don't emit fake dynamic array fields either
skip = (symbGetArrayDimensions( fld ) = -1)
end if

if( skip = FALSE ) then
Expand Down
10 changes: 7 additions & 3 deletions src/compiler/ir-llvm.bas
Expand Up @@ -787,9 +787,13 @@ private sub hEmitStruct( byval s as FBSYMBOL ptr )
'' Write out the elements
fld = symbUdtGetFirstField( s )
while( fld )
ln += hEmitSymType( fld )
ln += hEmitArrayDecl( fld )
ln += attrib

'' Don't emit fake dynamic array fields
if( symbGetArrayDimensions( fld ) <> -1 ) then
ln += hEmitSymType( fld )
ln += hEmitArrayDecl( fld )
ln += attrib
end if

fld = symbUdtGetNextField( fld )
if( fld ) then
Expand Down

0 comments on commit 88412ea

Please sign in to comment.