[PATCH] Additional fix for PR14269: Clang crashes when a bit field is used as inline assembler input / output with memory constraint

Andrey Bokhanko andreybokhanko at gmail.com
Tue Jun 16 08:11:23 PDT 2015


Hi majnemer, mcrosier, echristo, rsmith,

In his post-review for my fix (http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20150608/130464.html) Richard Smith wrote:

> What about other weird kinds of lvalues, like the result of `__real` / `__imag`, vector indexing, and global register variables? Those have the same problem; CGStmt.cpp blindly calls `LValue::getAddress` without checking for those cases.

This patch fixes these cases:

> like the result of `__real` / `__imag`

This already works well -- no errors printed for __real (as they can be handled just fine), a error ("invalid lvalue in asm output") is printed for __imag.

I can't create a test case that leads either to compile time fail or incorrect code generation.

> vector indexing

Fixed

> and global register variables

Fixed

http://reviews.llvm.org/D10476

Files:
  include/clang/AST/Expr.h
  include/clang/Basic/DiagnosticSemaKinds.td
  lib/AST/Expr.cpp
  lib/Sema/SemaStmtAsm.cpp
  test/Sema/asm.c

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10476.27762.patch
Type: text/x-patch
Size: 5814 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150616/4262c3c5/attachment.bin>


More information about the cfe-commits mailing list