fixed several bugs with object sizes
This commit is contained in:
parent
36b11dc296
commit
0f2f6da38f
|
@ -264,10 +264,14 @@ CodeEndBlock(df, StackAdjustment)
|
||||||
C_cal("_nfa");
|
C_cal("_nfa");
|
||||||
C_asp(word_size);
|
C_asp(word_size);
|
||||||
}
|
}
|
||||||
|
if( tp->tp_size == word_size )
|
||||||
|
C_lol(-tp->tp_size);
|
||||||
if( tp->tp_size == 2 * word_size )
|
if( tp->tp_size == 2 * word_size )
|
||||||
C_ldl(-tp->tp_size);
|
C_ldl(-tp->tp_size);
|
||||||
else
|
else {
|
||||||
C_lol(-tp->tp_size);
|
C_lal(-tp->tp_size);
|
||||||
|
C_loi(tp->tp_size);
|
||||||
|
}
|
||||||
|
|
||||||
C_ret(tp->tp_size);
|
C_ret(tp->tp_size);
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,12 +164,20 @@ CodeValue(ds, tp)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DSG_FIXED:
|
case DSG_FIXED:
|
||||||
if( ds->dsg_offset % word_size == 0 && size == word_size ) {
|
if( ds->dsg_offset % word_size == 0 ) {
|
||||||
|
if ( size == word_size ) {
|
||||||
if( ds->dsg_name )
|
if( ds->dsg_name )
|
||||||
C_loe_dnam(ds->dsg_name, ds->dsg_offset);
|
C_loe_dnam(ds->dsg_name, ds->dsg_offset);
|
||||||
else
|
else
|
||||||
C_lol(ds->dsg_offset);
|
C_lol(ds->dsg_offset);
|
||||||
break;
|
break;
|
||||||
|
} else if ( size == word_size * 2) {
|
||||||
|
if( ds->dsg_name )
|
||||||
|
C_lde_dnam(ds->dsg_name, ds->dsg_offset);
|
||||||
|
else
|
||||||
|
C_ldl(ds->dsg_offset);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* Fall through */
|
/* Fall through */
|
||||||
case DSG_PLOADED:
|
case DSG_PLOADED:
|
||||||
|
@ -209,12 +217,20 @@ CodeStore(ds, tp)
|
||||||
|
|
||||||
switch( ds->dsg_kind ) {
|
switch( ds->dsg_kind ) {
|
||||||
case DSG_FIXED:
|
case DSG_FIXED:
|
||||||
if( ds->dsg_offset % word_size == 0 && size == word_size ) {
|
if( ds->dsg_offset % word_size == 0 ) {
|
||||||
|
if ( size == word_size ) {
|
||||||
if( ds->dsg_name )
|
if( ds->dsg_name )
|
||||||
C_ste_dnam(ds->dsg_name, ds->dsg_offset);
|
C_ste_dnam(ds->dsg_name, ds->dsg_offset);
|
||||||
else
|
else
|
||||||
C_stl(ds->dsg_offset);
|
C_stl(ds->dsg_offset);
|
||||||
break;
|
break;
|
||||||
|
} else if ( size == word_size * 2) {
|
||||||
|
if( ds->dsg_name )
|
||||||
|
C_sde_dnam(ds->dsg_name, ds->dsg_offset);
|
||||||
|
else
|
||||||
|
C_sdl(ds->dsg_offset);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* Fall through */
|
/* Fall through */
|
||||||
case DSG_PLOADED:
|
case DSG_PLOADED:
|
||||||
|
@ -263,11 +279,19 @@ CodeAddress(ds)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DSG_PFIXED:
|
case DSG_PFIXED:
|
||||||
|
if ( word_size == pointer_size ) {
|
||||||
if( ds->dsg_name )
|
if( ds->dsg_name )
|
||||||
C_loe_dnam(ds->dsg_name, ds->dsg_offset);
|
C_loe_dnam(ds->dsg_name, ds->dsg_offset);
|
||||||
else
|
else
|
||||||
C_lol(ds->dsg_offset);
|
C_lol(ds->dsg_offset);
|
||||||
break;
|
break;
|
||||||
|
} else {
|
||||||
|
if( ds->dsg_name )
|
||||||
|
C_lde_dnam(ds->dsg_name, ds->dsg_offset);
|
||||||
|
else
|
||||||
|
C_ldl(ds->dsg_offset);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case DSG_INDEXED:
|
case DSG_INDEXED:
|
||||||
C_aar(word_size);
|
C_aar(word_size);
|
||||||
|
|
Loading…
Reference in a new issue