File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -637,21 +637,23 @@ class TestLeakAutoVar : public TestFixture {
637
637
}
638
638
639
639
void memcpyWithPtr1 () { // #11542
640
+ const Settings s = settingsBuilder ().library (" std.cfg" ).library (" posix.cfg" ).build ();
640
641
check (" #include <string.h>\n "
641
642
" void f(char** old, char* value) {\n "
642
643
" char *str = strdup(value);\n "
643
644
" memcpy(old, &str, sizeof(char*));\n "
644
- " }\n " );
645
+ " }\n " , &s );
645
646
ASSERT_EQUALS (" " , errout_str ());
646
647
}
647
648
648
649
void memcpyWithPtr2 () {
650
+ const Settings s = settingsBuilder ().library (" std.cfg" ).library (" posix.cfg" ).build ();
649
651
check (" #include <string.h>\n "
650
652
" void f(char* value) {\n "
651
653
" char *old = NULL;\n "
652
654
" char *str = strdup(value);\n "
653
655
" memcpy(&old, &str, sizeof(char*));\n "
654
- " }\n " );
656
+ " }\n " , &s );
655
657
// TODO: make this fail
656
658
ASSERT_EQUALS (" " , errout_str ());
657
659
}
You can’t perform that action at this time.
0 commit comments