Skip to content

Commit 45af7f4

Browse files
committed
plusplus: do code more transparent (remove hack)
1 parent 569513d commit 45af7f4

1 file changed

Lines changed: 13 additions & 14 deletions

File tree

bld/plusplus/c/opovload.c

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* Open Watcom Project
44
*
5-
* Copyright (c) 2002-2023 The Open Watcom Contributors. All Rights Reserved.
5+
* Copyright (c) 2002-2026 The Open Watcom Contributors. All Rights Reserved.
66
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
77
*
88
* ========================================================================
@@ -627,10 +627,7 @@ static PTREE resolve_symbols( // RESOLVE MULTIPLE OVERLOAD DEFINITIONS
627627
FNOV_RESULT ovret; // - overload return
628628
unsigned num_args; // - # of arguments
629629
SYMBOL fun; // - overloaded function to use
630-
struct // - arg.list
631-
{ arg_list base; // - - hdr, entry[1]
632-
TYPE arg2; // - - entry[2]
633-
} alist;
630+
arg_list *alist;
634631
FNOV_DIAG fnov_diag; // - diagnosis information
635632

636633
ExtraRptIncrementCtr( ctrResolveOps );
@@ -647,14 +644,15 @@ static PTREE resolve_symbols( // RESOLVE MULTIPLE OVERLOAD DEFINITIONS
647644
ScopeFreeResult( olinf->result_nonmem_namespace );
648645
return( olinf->expr );
649646
}
650-
InitArgList( &alist.base );
647+
alist = AllocArgListTemp( 2 );
648+
InitArgList( alist );
651649
zero_node = NULL;
652650
ptlist[0] = olinf->left.operand;
653-
alist.base.type_list[0] = olinf->left.node_type;
651+
alist->type_list[0] = olinf->left.node_type;
654652
if( olinf->flags & PTO_BINARY ) {
655653
if( olinf->mask & OPM_ASSIGN ) {
656654
ptlist[1] = olinf->right.operand;
657-
alist.base.type_list[1] = olinf->right.node_type;
655+
alist->type_list[1] = olinf->right.node_type;
658656
num_args = 2;
659657
} else if( olinf->mask & OPM_LT ) {
660658
num_args = 1;
@@ -663,26 +661,26 @@ static PTREE resolve_symbols( // RESOLVE MULTIPLE OVERLOAD DEFINITIONS
663661
olinf->scalars = NULL;
664662
}
665663
ptlist[1] = olinf->right.operand;
666-
alist.base.type_list[1] = olinf->right.node_type;
664+
alist->type_list[1] = olinf->right.node_type;
667665
num_args = 2;
668666
}
669667
} else if( olinf->mask & OPM_POST ) {
670668
zero_node = NodeZero();
671669
setupOVOP( olinf, zero_node, &olinf->right );
672670
ptlist[1] = olinf->right.operand;
673-
alist.base.type_list[1] = olinf->right.node_type;
671+
alist->type_list[1] = olinf->right.node_type;
674672
num_args = 2;
675673
} else {
676674
num_args = 1;
677675
}
678-
alist.base.num_args = num_args;
676+
alist->num_args = num_args;
679677
// this qualifier is handled explicitly by the first entry in the arg_list
680678
ovret = OpOverloadedDiag( &fun
681679
, olinf->result_mem
682680
, olinf->result_nonmem
683681
, olinf->result_nonmem_namespace
684682
, olinf->scalars
685-
, (arg_list*)&alist
683+
, alist
686684
, ptlist
687685
, &fnov_diag );
688686
if( ovret == FNOV_AMBIGUOUS && CompFlags.extensions_enabled ) {
@@ -723,7 +721,7 @@ static PTREE resolve_symbols( // RESOLVE MULTIPLE OVERLOAD DEFINITIONS
723721
, olinf->result_nonmem
724722
, olinf->result_nonmem_namespace
725723
, olinf->scalars
726-
, (arg_list*)&alist
724+
, alist
727725
, ptlist
728726
, FNC_STDOP_CV_VOID
729727
, &fnov_diag );
@@ -749,12 +747,13 @@ static PTREE resolve_symbols( // RESOLVE MULTIPLE OVERLOAD DEFINITIONS
749747
, olinf->result_nonmem
750748
, olinf->result_nonmem_namespace
751749
, olinf->scalars
752-
, (arg_list*)&alist
750+
, alist
753751
, ptlist
754752
, FNC_USE_WP13332
755753
, &fnov_diag );
756754
}
757755
}
756+
MemFree( alist );
758757
switch( ovret ) {
759758
case FNOV_AMBIGUOUS:
760759
{ FNOV_LIST* amb_list; // - ambiguity list

0 commit comments

Comments
 (0)