Skip to content

Commit

Permalink
C backend: Don't add cast during addrof argv (f96c09f regression)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkl committed Sep 17, 2014
1 parent 34138e5 commit 1f4b61d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/compiler/ir-hlc.bas
Expand Up @@ -1690,16 +1690,14 @@ private function exprNewSYM( byval sym as FBSYMBOL ptr ) as EXPRNODE ptr

n = exprNewCAST( typeAddrOf( symbGetType( sym ) ), symbGetSubtype( sym ), n )

'' main()'s argv? Add CAST to convert from char** to the one used by FB
'' main()'s argv? It's emitted as int8** (char**), not as uint8** (zstring ptr ptr),
'' so specify the type manually instead of deriving it from the FB symbol.
'' exprNewVREG() will add the cast to uint8** where needed.
elseif( (symbIsVar( sym ) or (sym->class = FB_SYMBCLASS_PARAM)) and _
((sym->stats and FB_SYMBSTATS_ARGV) <> 0) ) then

n = exprNew( EXPRCLASS_SYM, FB_DATATYPE_INVALID, NULL )
n = exprNew( EXPRCLASS_SYM, typeMultAddrOf( FB_DATATYPE_BYTE, 2 ), NULL )
n->sym = sym

n = exprNewCAST( typeMultAddrOf( FB_DATATYPE_CHAR, 2 ), NULL, n )
else

dtype = symbGetType( sym )
subtype = symbGetSubtype( sym )

Expand Down

0 comments on commit 1f4b61d

Please sign in to comment.