[LLVMdev] bug report on MC asm parser evaluating expressions

杨勇勇 triple.yang at gmail.com
Thu May 2 22:37:41 PDT 2013


Hi, developers,

I notice following asm symbol definitions are eveluated improperly:

A = 9
B = 3*A - 2 * A + 1

the value of B should be 10 instead of 8.

It seems asm parser treat "B = 3*A - 2 * A + 1" as "B = 3*A - (2 * A + 1)"
because the second "*" has higher precedence than "-", and evaluation just
performs simple recursion within AsmParser::ParseBinOpRHS (which resides in
file lib/MC/MCParser/AsmParser.cpp).

Can some one make a fixup?

Regard.
-- 
杨勇勇 (Yang Yong-Yong)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130503/0325d37c/attachment.html>


More information about the llvm-dev mailing list