Logic bug in pdfium - unreachable code |
|||
Issue description
The /analyze builder recently started giving this warning:
pdfium\xfa\fwl\basewidget\fwl_comboboximp.cpp(1101) : warning C6259: Labeled code is unreachable: '(<expression> & 0x3000)' in a switch-expr cannot evaluate to '0x400'.
pdfium\xfa\fwl\basewidget\fwl_comboboximp.cpp(1104) : warning C6259: Labeled code is unreachable: '(<expression> & 0x3000)' in a switch-expr cannot evaluate to '0x800'.
The code in question is:
switch (dwStylExes & FWL_STYLEEXT_CMB_ListItemAlignMask) {
case FWL_STYLEEXT_CMB_ListItemCenterAlign: {
dwAdd |= FWL_STYLEEXT_LTB_CenterAlign;
}
case FWL_STYLEEXT_CMB_ListItemRightAlign: {
dwAdd |= FWL_STYLEEXT_LTB_RightAlign;
}
default: { dwAdd |= FWL_STYLEEXT_LTB_LeftAlign; }
}
and indeed the constants do not overlap.
#define FWL_STYLEEXT_CMB_ListItemCenterAlign (1L << 10)
#define FWL_STYLEEXT_CMB_ListItemRightAlign (2L << 10)
...
#define FWL_STYLEEXT_CMB_ListItemAlignMask (3L << 12)
The code appears to have been broken since its inception - it's not clear why it is now triggering warnings. Perhaps something about the XFA changes?
Anyway, it's broken. It needs to be fixed with care since the fix will change its behavior.
Can you investigate or reassign?
Tracking bug for /analyze is 427616.
,
May 20 2016
Infra>Client>Pdfium is the wrong label, BTW.
,
May 20 2016
Darned auto-correct. I mean auto-complete. I'll try to remember. Infra did seem odd...
,
May 24 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/306588c7b8db5524635eb97559f0b7b76ced0c20 commit 306588c7b8db5524635eb97559f0b7b76ced0c20 Author: thestig <thestig@chromium.org> Date: Tue May 24 01:02:43 2016 Roll PDFium 3cbb6fb..490d612 https://pdfium.googlesource.com/pdfium.git/+log/3cbb6fb..490d612 BUG= 427616 , 613620 , 613623 TBR=ochang@chromium.org Review-Url: https://codereview.chromium.org/2008733002 Cr-Commit-Position: refs/heads/master@{#395498} [modify] https://crrev.com/306588c7b8db5524635eb97559f0b7b76ced0c20/DEPS
,
Jul 18 2016
somehow this never got flipped to "fixed". |
|||
►
Sign in to add a comment |
|||
Comment 1 by tsepez@chromium.org
, May 20 2016