| 3512 | } |
| 3513 | |
| 3514 | static bool isTruncated(const ValueType* src, const ValueType* dst, const Settings& settings) |
| 3515 | { |
| 3516 | if (src->pointer > 0 || dst->pointer > 0) |
| 3517 | return src->pointer != dst->pointer; |
| 3518 | if (src->smartPointer && dst->smartPointer) |
| 3519 | return false; |
| 3520 | if ((src->isIntegral() && dst->isIntegral()) || (src->isFloat() && dst->isFloat())) { |
| 3521 | const size_t srcSize = src->getSizeOf(settings, ValueType::Accuracy::LowerBound, ValueType::SizeOf::Pointer); |
| 3522 | const size_t dstSize = dst->getSizeOf(settings, ValueType::Accuracy::LowerBound, ValueType::SizeOf::Pointer); |
| 3523 | if (srcSize > dstSize) |
| 3524 | return true; |
| 3525 | if (srcSize == dstSize && src->sign != dst->sign) |
| 3526 | return true; |
| 3527 | } else if (src->type == dst->type) { |
| 3528 | if (src->type == ValueType::Type::RECORD) |
| 3529 | return src->typeScope != dst->typeScope; |
| 3530 | } else { |
| 3531 | return true; |
| 3532 | } |
| 3533 | return false; |
| 3534 | } |
| 3535 | |
| 3536 | static void setSymbolic(ValueFlow::Value& value, const Token* tok) |
| 3537 | { |
no test coverage detected