# HG changeset patch # User lindquist # Date 1212880078 -7200 # Node ID 61aa721a6b7f0f47f1df09a4fa0ac4315d2c8933 # Parent 79d8f6b3fbaf9c4445e57bcb0f9e9b8867efc74b [svn r247] fixed accessing global symbols from inline asm. diff -r 79d8f6b3fbaf -r 61aa721a6b7f gen/asmstmt.cpp --- a/gen/asmstmt.cpp Sat Jun 07 21:38:14 2008 +0200 +++ b/gen/asmstmt.cpp Sun Jun 08 01:07:58 2008 +0200 @@ -258,7 +258,7 @@ return; static std::string i_cns = "i"; - static std::string p_cns = "m"; + static std::string p_cns = "i"; static std::string l_cns = "X"; static std::string m_cns = "*m"; static std::string mw_cns = "=*m"; diff -r 79d8f6b3fbaf -r 61aa721a6b7f gen/d-asm-i386.h --- a/gen/d-asm-i386.h Sat Jun 07 21:38:14 2008 +0200 +++ b/gen/d-asm-i386.h Sun Jun 08 01:07:58 2008 +0200 @@ -1411,6 +1411,12 @@ insnTemplate->printf("%d", asmcode->args.dim); asmcode->args.push( new AsmArg(type, e, mode) ); } + void addOperand2(const char * fmtpre, const char * fmtpost, AsmArgType type, Expression * e, AsmCode * asmcode, AsmArgMode mode = Mode_Input) { + insnTemplate->writestring((char*) fmtpre); + insnTemplate->printf("%d", asmcode->args.dim); + insnTemplate->writestring((char*) fmtpost); + asmcode->args.push( new AsmArg(type, e, mode) ); + } void addLabel(unsigned n) { // No longer taking the address of the actual label -- doesn't seem like it would help. @@ -1909,7 +1915,7 @@ addOperand("$", Arg_Pointer, e, asmcode); } else if ((decl && decl->isCodeseg())) { // if function or label use_star = false; - addOperand("*$", Arg_Pointer, e, asmcode); + addOperand2("${", ":c}", Arg_Pointer, e, asmcode); } else { if (use_star) { insnTemplate->writebyte('*');