「view this page in B3 βῆτα server」

Revisions №60368

branch: master 「№60368」
Commited by: Vikram K. Mulligan
GitHub commit link: 「64d61ab7a9e5521d」 「№3428」
Difference from previous tested commit:  code diff
Commit date: 2018-08-27 11:53:48
linux.clang linux.gcc linux.srlz mac.clang
debug
release
unit
linux.PyRosetta.unit linux.gcc.python36.PyRosetta4.unit mac.PyRosetta.unit build.clean.debug cppcheck mysql postgres linux.zeromq.debug mpi mpi.serialization linux.icc.build.debug OpenCL build.header build.levels ninja graphics static mac.clang.static.build.release linux.ui mac.ui beautification code_quality.clang_analysis serialization integration.mpi integration.release_debug integration.tutorials integration maintenance.documentation performance profile linux.clang.python27.release.PyRosetta4.Debug linux.clang.python35.release.PyRosetta4.Debug linux.clang.python36.release.PyRosetta4.Debug linux.clang.python37.release.PyRosetta4.Debug mac.clang.python27.release.PyRosetta4.Debug mac.clang.python35.release.PyRosetta4.Debug mac.clang.python36.release.PyRosetta4.Debug linux.clang.python27.release.PyRosetta4.MinSizeRel linux.clang.python35.release.PyRosetta4.MinSizeRel linux.clang.python36.release.PyRosetta4.MinSizeRel linux.clang.python37.release.PyRosetta4.MinSizeRel mac.clang.python27.release.PyRosetta4.MinSizeRel mac.clang.python35.release.PyRosetta4.MinSizeRel mac.clang.python36.release.PyRosetta4.MinSizeRel ubuntu.clang.python27.release.PyRosetta4.MinSizeRel ubuntu.clang.python35.release.PyRosetta4.MinSizeRel linux.clang.python27.release.PyRosetta4.Release linux.clang.python35.release.PyRosetta4.Release linux.clang.python36.release.PyRosetta4.Release linux.clang.python37.release.PyRosetta4.Release mac.clang.python27.release.PyRosetta4.Release mac.clang.python35.release.PyRosetta4.Release mac.clang.python36.release.PyRosetta4.Release ubuntu.clang.python27.release.PyRosetta4.Release ubuntu.clang.python35.release.PyRosetta4.Release ubuntu.clang.python37.release.PyRosetta4.Release release.source linux.clang.score linux.gcc.score mac.clang.score linux.scripts.pyrosetta scripts.rosetta.parse scripts.rosetta.validate scripts.rosetta.verify linux.clang.unit.release linux.gcc.unit.release

Merge pull request #3428 from RosettaCommons/vmullig/fix_parametric_ubsan_issue Trying to fix an ubsan issue that I introduced when refactoring the parametric code I had a base class with a method in it that could be used to determine the derived class, and a switch statement of the following pattern: ```c++ // Using static_cast instead of dynamic_cast to avoid the overhead of a dynamic_cast, since I // don't need dynamic_cast to tell me the derived class type because I have the class function // instead: DerivedClass1OP class1pointer( static_pointer_cast< DerivedClass1 >( baseclass_pointer ); DerivedClass2OP class2pointer( static_pointer_cast< DerivedClass2 >( baseclass_pointer ); switch( baseclass->tell_me_derived_class() ) { case class1: // Do stuff with the class1pointer break; case class2: // Do stuff with the class2pointer break; } ``` This meant that I was guaranteed to be setting up at least one pointer that had been invalidly static-casted to the wrong type, but I was never using it, so it didn't matter. The code was working as written, but was probably a bit fragile and non-ideal, and was tripping up the Ubsan tests. (If ever someone modified it and _did_ try to do something with the wrong pointer, it would cause nasty things to happen.) I've refactored it to follow this safer pattern instead: ```c++ switch( baseclass->tell_me_derived_class() ) { case class1: { //Scope for declaration DerivedClass1OP class1pointer( static_pointer_cast< DerivedClass1 >( baseclass_pointer ); // Do stuff with the class1pointer break; } case class2: { //Scope for declaration DerivedClass2OP class2pointer( static_pointer_cast< DerivedClass2 >( baseclass_pointer ); // Do stuff with the class2pointer break; } } ```