Skip to content

Commit

Permalink
revert back wrong change
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalak committed Sep 3, 2022
1 parent 6008366 commit 4f6dc0c
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions bld/plusplus/c/cpragx86.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,12 +649,13 @@ static int insertFixups( VBUF *src_code )
#endif
VBUF out_code;

len = VbufLen( src_code );
src_start = VbufBuffer( src_code );
uses_auto = false;
perform_fixups = false;
if( FixupHead != NULL ) {
head = FixupHead;
head = FixupHead;
if( head == NULL ) {
out_code = *src_code;
} else {
VbufInit( &out_code );
FixupHead = NULL;
/* sort the fixup list in increasing fixup_loc's */
for( fix = head; fix != NULL; fix = next ) {
Expand All @@ -671,19 +672,19 @@ static int insertFixups( VBUF *src_code )
fix->next = *owner;
*owner = fix;
}
src_end = src_start + len;
len = 0;
cg_fix = 0;
sym = NULL;
VbufInit( &out_code );
len = 0;
src_start = VbufBuffer( src_code );
src_end = src_start + VbufLen( src_code );
fix = FixupHead;
owner = &FixupHead;
/* insert fixup escape sequences */
for( src = src_start; src < src_end; ) {
/* reserve at least ASM_BLOCK bytes in the buffer */
VbufReqd( &out_code, _RoundUp( len + ASM_BLOCK, ASM_BLOCK ) );
dst = VbufBuffer( &out_code );
if( fix != NULL && fix->fixup_loc == ( src - src_start ) ) {
if( fix != NULL && fix->fixup_loc == (src - src_start) ) {
name = NULL;
if( fix->name != NULL ) {
name = NameCreateNoLen( fix->name );
Expand Down Expand Up @@ -813,13 +814,12 @@ static int insertFixups( VBUF *src_code )
VbufSetLen( &out_code, len );
}
perform_fixups = true;
len = VbufLen( &out_code );
src_start = VbufBuffer( &out_code );
}
len = VbufLen( &out_code );
seq = CMemAlloc( offsetof( byte_seq, data ) + len );
seq->relocs = perform_fixups;
seq->length = len;
memcpy( seq->data, src_start, len );
memcpy( seq->data, VbufBuffer( &out_code ), len );
CurrInfo->code = seq;
if( VbufBuffer( &out_code ) != VbufBuffer( src_code ) )
VbufFree( &out_code );
Expand Down

0 comments on commit 4f6dc0c

Please sign in to comment.