[llvm-bugs] [Bug 33861] New: Invalid scale in LEA crashes llvm-mc
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Jul 20 08:50:37 PDT 2017
https://bugs.llvm.org/show_bug.cgi?id=33861
Bug ID: 33861
Summary: Invalid scale in LEA crashes llvm-mc
Product: libraries
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: MC
Assignee: unassignedbugs at nondot.org
Reporter: davide at freebsd.org
CC: llvm-bugs at lists.llvm.org, llvm-dev at redking.me.uk
Single-line testcase:
$ cat patatino.s
lea RDX, [number * RAX + RBX + _foo]
Run:
$ ./llvm-mc -triple x86_64-unknown-unknown -x86-asm-syntax=intel patatino.s
.text
_test:
xorl %eax, %eax
retq
number = 8
.globl _foo
.globl main
main:
llvm-mc: ../lib/Target/X86/AsmParser/X86Operand.h:551: static
std::unique_ptr<llvm::X86Operand> llvm::X86Operand::CreateMem(unsigned int,
unsigned int, const llvm::MCExpr*, unsigned int, unsigned int, unsigned int,
llvm::SMLoc, llvm::SMLoc, unsigned int, llvm::StringRef, void*, unsigned int):
Assertion `((Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8)) && "Invalid
scale!"' failed.
#0 0x000000000077c2ea llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(./llvm-mc+0x77c2ea)
#1 0x000000000077a23e llvm::sys::RunSignalHandlers() (./llvm-mc+0x77a23e)
#2 0x000000000077a38c SignalHandler(int) (./llvm-mc+0x77a38c)
#3 0x00007f2fc5d70c30 __restore_rt (/lib64/libpthread.so.0+0x10c30)
#4 0x00007f2fc48dc765 __GI_raise (/lib64/libc.so.6+0x34765)
#5 0x00007f2fc48de36a __GI_abort (/lib64/libc.so.6+0x3636a)
#6 0x00007f2fc48d4f97 __assert_fail_base (/lib64/libc.so.6+0x2cf97)
#7 0x00007f2fc48d5042 (/lib64/libc.so.6+0x2d042)
#8 0x0000000000506669 llvm::X86Operand::CreateMem(unsigned int, unsigned int,
llvm::MCExpr const*, unsigned int, unsigned int, unsigned int, llvm::SMLoc,
llvm::SMLoc, unsigned int, llvm::StringRef, void*, unsigned int)
(./llvm-mc+0x506669)
#9 0x0000000000509b00 (anonymous
namespace)::X86AsmParser::ParseIntelBracExpression(unsigned int, llvm::SMLoc,
long, bool, unsigned int) (./llvm-mc+0x509b00)
#10 0x000000000050af7e (anonymous namespace)::X86AsmParser::ParseIntelOperand()
(./llvm-mc+0x50af7e)
#11 0x000000000050ba88 (anonymous namespace)::X86AsmParser::ParseOperand()
(./llvm-mc+0x50ba88)
#12 0x000000000050cec4 (anonymous
namespace)::X86AsmParser::ParseInstruction(llvm::ParseInstructionInfo&,
llvm::StringRef, llvm::SMLoc,
llvm::SmallVectorImpl<std::unique_ptr<llvm::MCParsedAsmOperand,
std::default_delete<llvm::MCParsedAsmOperand> > >&) (./llvm-mc+0x50cec4)
#13 0x0000000000437ad6
llvm::MCTargetAsmParser::ParseInstruction(llvm::ParseInstructionInfo&,
llvm::StringRef, llvm::AsmToken,
llvm::SmallVectorImpl<std::unique_ptr<llvm::MCParsedAsmOperand,
std::default_delete<llvm::MCParsedAsmOperand> > >&) (./llvm-mc+0x437ad6)
#14 0x0000000000715a63 (anonymous
namespace)::AsmParser::parseStatement((anonymous
namespace)::ParseStatementInfo&, llvm::MCAsmParserSemaCallback*) [clone
.constprop.506] (./llvm-mc+0x715a63)
#15 0x0000000000718d1b (anonymous namespace)::AsmParser::Run(bool, bool)
(./llvm-mc+0x718d1b)
#16 0x000000000041718a main (./llvm-mc+0x41718a)
#17 0x00007f2fc48c8731 __libc_start_main (/lib64/libc.so.6+0x20731)
#18 0x0000000000431249 _start (./llvm-mc+0x431249)
Stack dump:
0. Program arguments: ./llvm-mc -triple x86_64-unknown-unknown
-x86-asm-syntax=intel patatino.s
Aborted (core dumped)
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170720/4b0f2edd/attachment.html>
More information about the llvm-bugs
mailing list