Skip to content

Commit efda81b

Browse files
authored
Merge pull request #313 from SARG-FB/gas64_rev
gas64 : fix assembly error when .data section is inserted using asm/e…
2 parents 88538eb + f50958f commit efda81b

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/compiler/ir-gas64.bas

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -439,14 +439,14 @@ private sub check_optim(byref code as string)
439439
poschar1=instr(code," ")
440440
mov=left(code,poschar1-1)
441441
poschar2=instr(code,",")
442-
part1=mid(code,poschar1+1,poschar2-poschar1-1)
442+
part1=trim(mid(code,poschar1+1,poschar2-poschar1-1))
443443
poschar1=instr(code,"#")
444444
if poschar1=0 then
445-
poschar1=len(code)+1 ''Add 1 as after removing 2
445+
poschar1=len(code) ''Add 1 as after removing 2
446446
else
447-
poschar1-=1
447+
poschar1-=2
448448
end if
449-
part2=rtrim(Mid(code,poschar2+2,poschar1-poschar2-2))
449+
part2=trim(Mid(code,poschar2+1,poschar1-poschar2))
450450

451451
''cancel mov regx, regx
452452
if mov="mov" then
@@ -6188,11 +6188,7 @@ private sub _emitasmline( byval asmtokenhead as ASTASMTOK ptr )
61886188

61896189
select case( n->type )
61906190
case AST_ASMTOK_TEXT
6191-
if *n->text="," then ''add a space to avoid issue during optimization
6192-
asmline += ", "
6193-
else
6194-
asmline += *n->text
6195-
end if
6191+
asmline += *n->text
61966192
asm_info("asm text="+*n->text)
61976193
case AST_ASMTOK_SYMB
61986194

@@ -6210,7 +6206,7 @@ private sub _emitasmline( byval asmtokenhead as ASTASMTOK ptr )
62106206

62116207
n = n->next
62126208
wend
6213-
6209+
ctxdbg.lnum=-1 ''to avoid generation of label when debug on
62146210
asm_code(asmline)
62156211
end sub
62166212
private sub _emitvarinibegin( byval sym as FBSYMBOL ptr )

0 commit comments

Comments
 (0)