[cfe-dev] Possible fix for codegen bug with cond ? func1 : func2

David Chisnall csdavec at swansea.ac.uk
Fri May 16 05:36:56 PDT 2008


I encountered a very similar bug caused by the same bit of code.  In  
my case the issue was the LHS and RHS having different Objective-C  
pointer types (e.g. id and NSString*) which AST is treating as  
equivalent but LLVM regards as incompatible.  Your solution seems  
cleaner than mine (which only handled mismatched pointer types  
correctly), so I'll revert mine before I send updated versions of the  
diff to this list (hopefully soon...).

David

On 15 May 2008, at 22:57, Eli Friedman wrote:

> Potential patch attached.
>
> Testcase (currently crashes with clang -emit-llvm):
> int a();
> int b(int);
> int c() {return 1 ? a : b;}
>
> Anyone have any better suggestions for how to fix this?
>
> -Eli
> <tttt.txt>_______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list