================ @@ -298,9 +299,12 @@ class SymbolVal : public NonLoc { /// Value representing integer constant. class ConcreteInt : public NonLoc { public: - explicit ConcreteInt(const llvm::APSInt &V) : NonLoc(ConcreteIntKind, &V) {} + explicit ConcreteInt(APSIntPtr V) : NonLoc(ConcreteIntKind, V.get()) {} - const llvm::APSInt &getValue() const { return *castDataAs<llvm::APSInt>(); } + APSIntPtr getValue() const { + // This is safe because in the ctor we take a safe APSIntPtr. + return APSIntPtr::unsafeConstructor(castDataAs<llvm::APSInt>()); ---------------- steakhal wrote:
Basicall it all boils down to the fact that an sval has a single void pointer as a storage. I'm currently okay casting a pointer to and from void pointer of this storage. But I'd be uncomfortable bitcasting an APSIntPtr object into a void pointer storage, even if it only holds a single pointer inside. This is why I preferred unboxing the pointer and holding that inside the SVal. Maybe I overlooked some other techniques. Let me know if you have something in mind. https://github.com/llvm/llvm-project/pull/120436 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits