New issue
Advanced search Search tips

Issue 613620 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug



Sign in to add a comment

Logic bug in pdfium - unreachable code

Project Member Reported by brucedaw...@chromium.org, May 20 2016

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.
 

Comment 1 by tsepez@chromium.org, May 20 2016

Status: Started (was: Assigned)
Components: -Infra>Client>Pdfium Internals>Plugins>PDF
Labels: OS-Windows
Infra>Client>Pdfium is the wrong label, BTW.
Darned auto-correct. I mean auto-complete. I'll try to remember. Infra did seem odd...

Comment 5 by tsepez@chromium.org, Jul 18 2016

Status: Fixed (was: Started)
somehow this never got flipped to "fixed".

Sign in to add a comment