30 jan 2009 kl. 09.31 skrev Eli Friedman: > On Fri, Jan 30, 2009 at 8:41 AM, Anders Carlsson <[email protected]> > wrote: >> @@ -684,7 +684,10 @@ >> // sizeof(type) - make sure to emit the VLA size. >> CGF.EmitVLASize(TypeToSize); >> } >> - return CGF.GetVLASize(VAT); >> + >> + llvm::Value *VLASize = CGF.GetVLASize(VAT); >> + return Builder.CreateIntCast(VLASize, ConvertType(E- >> >getType()), >> + false, "conv"); >> } >> } > > This seems like a relatively late place to put the cast; we should be > computing the size in type size_t, I think. Are you sure there isn't > a missing cast earlier? > > -Eli
Hmm, yeah - we could probably add an implicit cast to the size_t type for the VLA size expr. Not sure what something like int a[(unsigned long long)f()] would do in 32-bit, but given that the alloca instruction only takes a 32-bit constant that isn't an issue anyway :) What do you think? Anders _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
