[llvm-commits] [PATCH] bug 6028: fix interpreter assertion on use of undefined integer value
Jay Foad
jay.foad at gmail.com
Thu Jan 14 13:14:23 PST 2010
2010/1/14 Nick Lewycky <nicholas at mxc.ca>:
> Always make sure to run 'make check' before committing any change. If you're
> paranoid, you can also try out a nightly build before and after, but I don't
> think we care that much :) The nightly test has many failures due to things
> like taking addresses of functions and passing them around (to qsort for
> example).
OK, it passes "make check".
> Why care about the type? Why not just:
>
> if (isa<UndefValue>(C)) {
> GenericValue Result;
> Result.IntVal = APInt(C->getType()->getPrimitiveSizeInBits(), 0);
> return Result;
> }
Because for pointer types this will try to create a 0-bit-wide APInt, and fail.
Anyway, I think my version is clearer, because it initialises
Result.IntVal when and only when it is necessary.
Thanks,
Jay.
More information about the llvm-commits
mailing list