Bug 399444 - VEX/priv/guest_s390_toIR.c:17407]: (style) Mismatching assignment and comparison
Summary: VEX/priv/guest_s390_toIR.c:17407]: (style) Mismatching assignment and comparison
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.13 SVN
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-06 14:29 UTC by dcb314
Modified: 2018-10-10 18:33 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Drop unnecessary check in s390_irgen_VSLDB (1.31 KB, patch)
2018-10-09 11:03 UTC, Andreas Arnez
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dcb314 2018-10-06 14:29:55 UTC
SUMMARY

[valgrind/VEX/priv/guest_s390_toIR.c:17401] -> [valgrind/VEX/priv/guest_s390_toIR.c:17407]: (style) Mismatching assignment and comparison, comparison 'imm==16' is always false.

Source code is

   UChar imm = i4 & 0b00001111;

   if (imm == 0)
   {
      put_vr_qw(v1, get_vr_qw(v2));
   }
   else if (imm == 16)
   {
      put_vr_qw(v1, get_vr_qw(v3));

imm can never be equal to 16.

STEPS TO REPRODUCE
1. 
2. 
3. 

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE VERSIONS
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Andreas Arnez 2018-10-09 11:03:37 UTC
Created attachment 115505 [details]
Drop unnecessary check in s390_irgen_VSLDB

Trivial patch to remove the unnecessary special-case handling.  If no one objects, I'll push this.
Comment 2 Andreas Arnez 2018-10-10 12:28:06 UTC
(In reply to Andreas Arnez from comment #1)
> Created attachment 115505 [details]
> Drop unnecessary check in s390_irgen_VSLDB
Pushed.  Thanks again for reporting this!
Comment 3 dcb314 2018-10-10 18:33:27 UTC
(In reply to Andreas Arnez from comment #2)
> Pushed.  Thanks again for reporting this!

You are welcome. Not everything that static analyser "cppcheck"
reports is worth fixing, but this one was.

I usually run cppcheck over valgrind once a month or so.