ericmckean / pdfium

Automatically exported from code.google.com/p/pdfium
0 stars 0 forks source link

There a lot of comparisons between this and NULL in fpdf_parser_objects.cpp #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Invoking methods through a NULL pointer is UB in C/C++. Compiler can use this 
UB to optimize out comparisons between this and NULL.

See also http://www.viva64.com/en/b/0226/ for additional problems.

Original issue reported on code.google.com by halya...@chromium.org on 25 May 2014 at 8:08

GoogleCodeExporter commented 9 years ago

Original comment by bo...@foxitsoftware.com on 2 Jun 2014 at 11:06

GoogleCodeExporter commented 9 years ago
clang now warns on this, and optimizes away this check (chromium:381910)

Original comment by thakis@chromium.org on 7 Jun 2014 at 5:27

GoogleCodeExporter commented 9 years ago

Original comment by thakis@chromium.org on 7 Jun 2014 at 5:27

GoogleCodeExporter commented 9 years ago
I asked on the list about this: 
https://groups.google.com/forum/#!topic/pdfium/8mTxtmle4ok

Original comment by thakis@chromium.org on 13 Jun 2014 at 10:42

GoogleCodeExporter commented 9 years ago
Patch is about to land: https://codereview.chromium.org/361553002/

Original comment by thakis@chromium.org on 30 Jun 2014 at 4:43

GoogleCodeExporter commented 9 years ago

Original comment by bo...@foxitsoftware.com on 30 Jun 2014 at 4:44

GoogleCodeExporter commented 9 years ago
Fixed in 
https://pdfium.googlesource.com/pdfium/+/287e11a213d3197ac3e321acf294d903b271c26
9

Original comment by bo...@foxitsoftware.com on 30 Jun 2014 at 4:52