relaxcn wrote:

> I suppose this patch was motivated by a real-world use case, so I wonder if 
> we should add that to the LIT tests?

Yes. We have a lit test in downstream but the feature which triggers the bug 
doesn't exist in the upstream.

We implemented the `VisitSymbolCast` method in downstream:

```cpp
RangeSet VisitSymbolCast(const SymbolCast *Sym) {
  return RangeFactory.castTo(infer(Sym->getOperand()),
                             ValueFactory.getAPSIntType(Sym->getType()));
}
```

Considering the `unsigned __int128 -> unsigned long`, it triggers this bug.

So for this patch, there is no lit test which could really trigger this bug. 
The only behavior of the usage in the current code is casting  to the wider of 
the two operand types and never truncates so this bug would never occur. - just 
like I said in the desc of the PR.



https://github.com/llvm/llvm-project/pull/239147
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to