[LLVMdev] SIGILL in regex::assign()

Tim Northover t.p.northover at gmail.com
Thu Feb 12 20:57:44 PST 2015


Hi Paweł

> Where should I report the bug?

LLVM appears to be calling this function from libstdc++'s regex.h
(4.9.2 in my case):

basic_regex& assign(basic_regex&& __rhs)
{
  _M_flags = __rhs._M_flags;
  _M_original_str = std::move(__rhs._M_original_str);
  __rhs._M_automaton.reset();
  this->imbue(__rhs.getloc());
}

This is declared to return a basic_regex but doesn't, which LLVM ends
up emitting an undefined instruction trap for. This is valid because
the function has undefined behaviour.

So I say libstdc++, unless they've already fixed it.

Cheers.

Tim.




More information about the llvm-dev mailing list