Last active
December 25, 2015 18:09
-
-
Save ridiculousfish/7017899 to your computer and use it in GitHub Desktop.
clang UBSan test case fails at -O1 and above
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
struct obj1_t | |
{ | |
std::string text; | |
int val; | |
}; | |
struct obj2_t | |
{ | |
int val; | |
char padding[16]; | |
}; | |
struct obj3_t | |
{ | |
int field1; | |
int field2; | |
long long aligner; | |
void func(obj2_t obj2, int param, ...) | |
{ | |
this->field1 = true; | |
if (param && this->field2) | |
{ | |
obj1_t obj1; | |
obj1.val = obj2.val; | |
} | |
} | |
}; | |
int main(void) | |
{ | |
obj2_t obj; | |
obj3_t p; | |
p.func(obj, 0); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment