From 568d08f296300c034361b17c8121e907eef79336 Mon Sep 17 00:00:00 2001 From: dkl Date: Thu, 24 Apr 2014 21:49:19 +0200 Subject: [PATCH] parser: Clarify hPatchByvalResultToSelf()'s handling of BYREF results 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. --- src/compiler/parser-decl-struct.bas | 15 ++++++--------- todo.txt | 3 --- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/compiler/parser-decl-struct.bas b/src/compiler/parser-decl-struct.bas index 1dced00d31..986fd0331e 100644 --- a/src/compiler/parser-decl-struct.bas +++ b/src/compiler/parser-decl-struct.bas @@ -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 diff --git a/todo.txt b/todo.txt index 943da48fb9..7fc5f14cac 100644 --- a/todo.txt +++ b/todo.txt @@ -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