Skip to content

Commit

Permalink
v2.16
Browse files Browse the repository at this point in the history
  • Loading branch information
Baron-von-Riedesel committed Nov 14, 2022
1 parent d0b9cbe commit 8623cfe
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion History.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Changelog

__.__.2022, v2.16:
14.11.2022, v2.16:

Bugfixes:
- format mz: in the binary map of listings, the RVA of segments belonging
Expand Down Expand Up @@ -51,6 +51,8 @@
0x140000000 for PE64 exes, 0x180000000 for PE64 dlls (MS link compat).
- error 2058 ( "magnitude of offset exceeds 16-bit" ) changed to a warning
( level 3 ); see offset15.asm & offset16.asm.
- if option -Zg is on, OPATTR is to return language bits for procs/protos
only; see opattr10.asm.

09.04.2022, v2.15:

Expand Down
3 changes: 2 additions & 1 deletion src/data.c
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,8 @@ ret_code data_dir( int i, struct asm_tok tokenarray[], struct asym *type_sym )
#if 1
/* v2.11: Set the symbol's langtype. It may have been set
* by a PUBLIC directive, so take care not to overwrite it.
* Problem: Masm doesn't do this - might be a bug.
* Problem: Masm doesn't do this - might be a bug, but it
* affects return value of OPATTR.
*/
if ( sym->langtype == LANG_NONE )
sym->langtype = ModuleInfo.langtype;
Expand Down
9 changes: 7 additions & 2 deletions src/expreval.c
Original file line number Diff line number Diff line change
Expand Up @@ -1302,6 +1302,8 @@ enum opattr_bits {
/*
* T_DOT_TYPE: implement .TYPE as an alias for OPATTR
* T_OPATTR:
* compatibility: Masm (tested v6-9) sets the language bits ( bits 8-10 )
* for PROCs only, not for labels ( even if they are declared public with language attribute )
*/
static ret_code opattr_op( int oper, struct expr *opnd1, struct expr *opnd2, struct asym *sym, char *name )
/*********************************************************************************************************/
Expand Down Expand Up @@ -1391,8 +1393,11 @@ static ret_code opattr_op( int oper, struct expr *opnd1, struct expr *opnd2, str
if ( oper == T_OPATTR )
/* v2.12: no language if symbol isn't defined properly */
//if ( opnd2->sym )
if ( opnd2->sym && opnd2->kind != EXPR_ERROR )
opnd1->value |= opnd2->sym->langtype << 8;
if ( opnd2->sym && opnd2->kind != EXPR_ERROR ) {
/* v2.16: for Masm compatible code generation (-Zg), language must only be set if isproc=true */
if ( opnd2->sym->isproc || ( Options.masm_compat_gencode == FALSE ) )
opnd1->value |= opnd2->sym->langtype << 8;
}

DebugMsg1(("opattr_op returns %Xh\n", opnd1->value));
return( NOT_ERROR );
Expand Down

0 comments on commit 8623cfe

Please sign in to comment.