libmwaw_applepict2::PictParser::PictParser (src/lib/MWAWPictMac.cxx) downcasts libmwaw_applepict1::OpCode members of libmwaw_applepict1::s_listCodes to libmwaw_applepict2::OpCode, which gets flagged by -fsanitze=undefined.
A minimal workaround is to remove the unnecessary-anyway virtual destructor of libmwaw_applepict1::OpCode, which prevents -fsanitize=undefined from detecting the problem. See attached minimal.patch.
An additional fix is to reduce the libmwaw_applepict2::OpCode derivation to a non-member function libmwaw_applepict2::readData2 (which requires changing the static member function libmwaw_applepict1::OpCode::readValue from protected to public), removing the need for any invalid downcasts. See attached additional.patch.
Anonymous
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Hello,
I will do a commit this week-end to fix this problem which will probably remove the libmwaw_applepict2::OpCode class and check if we need realignment in libmwaw_applepict2 ::PictParser::parse after calling readData...
Note: actually nothing creates a libmwaw_applepict2::PictParser, I only reactive it when I find a spurious pict that I want to analyze...
osnola
Last edit: alonso laurent 2014-08-29
http://sourceforge.net/p/libmwaw/libmwaw/ci/023189186c487dd02462b0fc17f3f4f7afdab363/
must fix this warning...