Skip to content

Commit

Permalink
parser: Clarify hPatchByvalResultToSelf()'s handling of BYREF results
Browse files Browse the repository at this point in the history
symbProcRecalcRealType() already takes BYREF results into account, so
recalculating it doesn't cause issues, it's just unnecessary. This adjusts
hPatchByvalResultToSelf() to avoid doing it.
  • Loading branch information
dkl committed Apr 24, 2014
1 parent f96c09f commit 568d08f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
15 changes: 6 additions & 9 deletions src/compiler/parser-decl-struct.bas
Expand Up @@ -1099,25 +1099,22 @@ private sub hPatchByvalParamsToSelf( byval parent as FBSYMBOL ptr )

end sub

'':::::
private sub hPatchByvalResultToSelf _
( _
byval parent as FBSYMBOL ptr _
) static

dim as FBSYMBOL ptr sym
private sub hPatchByvalResultToSelf( byval parent as FBSYMBOL ptr )
dim as FBSYMBOL ptr sym = any

'' for each method..
sym = symbGetUDTSymbtb( parent ).head
do while( sym <> NULL )

if( symbIsProc( sym ) ) then
'' byval result to self? reset..
if( symbGetSubtype( sym ) = parent ) then
if( (symbGetType( sym ) = FB_DATATYPE_STRUCT) and _
(symbGetSubtype( sym ) = parent) and _
(not symbProcReturnsByref( sym )) ) then
symbProcRecalcRealType( sym )
end if
end if

sym = sym->next
loop

end sub
3 changes: 0 additions & 3 deletions todo.txt
Expand Up @@ -92,9 +92,6 @@ o -exx should catch...
[ ] operator overloading:
- OPERATOR foo.() ( lb1, lb2, ..... ) AS TYPE -- array indexing, not functor

o BYREF function results
- hPatchByvalResultToSelf() should probably check symbProcReturnsByref() now

[ ] quirks:
[ ] OPEN ... FOR is not checking for mode
- does QB allow that? CONS won't work without INPUT or OUTPUT
Expand Down

0 comments on commit 568d08f

Please sign in to comment.