diff options
| author | Pekka Jaaskelainen <pekka.jaaskelainen@tut.fi> | 2014-12-19 18:04:27 +0000 |
|---|---|---|
| committer | Pekka Jaaskelainen <pekka.jaaskelainen@tut.fi> | 2014-12-19 18:04:27 +0000 |
| commit | e94b0e187005ddbc3e5e8018829fada07379a542 (patch) | |
| tree | c17430d467b933e3eb80184ea07aca1300d2736f /clang/lib | |
| parent | cd8500e500d9359575a1b762d8dfc7d608e20d47 (diff) | |
| download | bcm5719-llvm-e94b0e187005ddbc3e5e8018829fada07379a542.tar.gz bcm5719-llvm-e94b0e187005ddbc3e5e8018829fada07379a542.zip | |
Fix an address space id reset with array decay's
implicit conversion.
The issue was produced with OpenCL C code that
called a function with a constant string literal
argument.
llvm-svn: 224592
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/CodeGen/CGExprScalar.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp index a4430dffb05..0fef4462eb9 100644 --- a/clang/lib/CodeGen/CGExprScalar.cpp +++ b/clang/lib/CodeGen/CGExprScalar.cpp @@ -1412,7 +1412,8 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) { if (!E->getType()->isVariableArrayType()) { assert(isa<llvm::PointerType>(V->getType()) && "Expected pointer"); V = CGF.Builder.CreatePointerCast( - V, ConvertType(E->getType())->getPointerTo()); + V, ConvertType(E->getType())->getPointerTo( + V->getType()->getPointerAddressSpace())); assert(isa<llvm::ArrayType>(V->getType()->getPointerElementType()) && "Expected pointer to array"); |

