Changeset 624:eb444ed4a2d3
- Timestamp:
- 10/01/08 13:15:01
(3 months ago)
- Author:
- Christian Kamm <kamm incasoftware de>
- branch:
- default
- Message:
Make invalid compile time casts an error instead of asserting.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r622 |
r624 |
|
| 830 | 830 | |
|---|
| 831 | 831 | LLConstant* c = e1->toConstElem(p); |
|---|
| 832 | | assert(isaPointer(c->getType())); |
|---|
| 833 | | |
|---|
| 834 | 832 | const LLType* lltype = DtoType(type); |
|---|
| 835 | | assert(isaPointer(lltype)); |
|---|
| | 833 | |
|---|
| | 834 | if(!isaPointer(c->getType()) || !isaPointer(lltype)) { |
|---|
| | 835 | error("can only cast pointers to pointers at compile time, not %s to %s", type->toChars(), e1->type->toChars()); |
|---|
| | 836 | fatal(); |
|---|
| | 837 | } |
|---|
| 836 | 838 | |
|---|
| 837 | 839 | return llvm::ConstantExpr::getBitCast(c, lltype); |
|---|