Add test for #10350, fix arg direction in windows.cfg (#5328)

This commit is contained in:
chrchr-github 2023-08-14 17:25:00 +02:00 committed by GitHub
parent 8aa9d710d1
commit 824f89514a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 9 deletions

View File

@ -2176,7 +2176,7 @@
<noreturn>false</noreturn> <noreturn>false</noreturn>
<returnValue type="HRESULT"/> <returnValue type="HRESULT"/>
<leak-ignore/> <leak-ignore/>
<arg nr="1" direction="in"> <arg nr="1">
<not-uninit/> <not-uninit/>
</arg> </arg>
<arg nr="2" direction="in"> <arg nr="2" direction="in">
@ -3432,7 +3432,7 @@ HFONT CreateFont(
<arg nr="9" direction="in"> <arg nr="9" direction="in">
<not-uninit/> <not-uninit/>
</arg> </arg>
<arg nr="10" direction="in"> <arg nr="10">
<not-uninit/> <not-uninit/>
</arg> </arg>
<arg nr="11" direction="in"> <arg nr="11" direction="in">
@ -3487,7 +3487,7 @@ HFONT CreateFont(
<arg nr="10" direction="in"> <arg nr="10" direction="in">
<not-uninit/> <not-uninit/>
</arg> </arg>
<arg nr="11" direction="in"> <arg nr="11">
<not-uninit/> <not-uninit/>
</arg> </arg>
<arg nr="12" direction="in"> <arg nr="12" direction="in">
@ -3501,7 +3501,7 @@ HFONT CreateFont(
<noreturn>false</noreturn> <noreturn>false</noreturn>
<returnValue type="BOOL"/> <returnValue type="BOOL"/>
<leak-ignore/> <leak-ignore/>
<arg nr="1" direction="in"> <arg nr="1">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
</arg> </arg>
@ -4726,7 +4726,7 @@ HFONT CreateFont(
<returnValue type="HMODULE"/> <returnValue type="HMODULE"/>
<use-retval/> <use-retval/>
<leak-ignore/> <leak-ignore/>
<arg nr="1" direction="in"> <arg nr="1">
<not-uninit/> <not-uninit/>
<strz/> <strz/>
</arg> </arg>
@ -4806,7 +4806,7 @@ HFONT CreateFont(
<function name="FreeLibraryAndExitThread"> <function name="FreeLibraryAndExitThread">
<noreturn>true</noreturn> <noreturn>true</noreturn>
<returnValue type="VOID"/> <returnValue type="VOID"/>
<arg nr="1" direction="in"> <arg nr="1">
<not-uninit/> <not-uninit/>
<not-bool/> <not-bool/>
</arg> </arg>
@ -4821,7 +4821,7 @@ HFONT CreateFont(
<noreturn>false</noreturn> <noreturn>false</noreturn>
<leak-ignore/> <leak-ignore/>
<returnValue type="DWORD"/> <returnValue type="DWORD"/>
<arg nr="1" direction="in"> <arg nr="1">
<not-uninit/> <not-uninit/>
<not-bool/> <not-bool/>
</arg> </arg>
@ -5646,7 +5646,7 @@ HFONT CreateFont(
<returnValue type="int"/> <returnValue type="int"/>
<leak-ignore/> <leak-ignore/>
<!-- The function does nothing (useful) if arg1 is nullptr or arg2 is nullptr or arg3 is 0 --> <!-- The function does nothing (useful) if arg1 is nullptr or arg2 is nullptr or arg3 is 0 -->
<arg nr="1" direction="in"> <arg nr="1">
<not-null/> <not-null/>
</arg> </arg>
<arg nr="2" direction="out"> <arg nr="2" direction="out">
@ -6791,7 +6791,7 @@ HFONT CreateFont(
<returnValue type="HWND"/> <returnValue type="HWND"/>
<use-retval/> <use-retval/>
<leak-ignore/> <leak-ignore/>
<arg nr="1" direction="in"> <arg nr="1">
<not-uninit/> <not-uninit/>
</arg> </arg>
<arg nr="2" direction="in"> <arg nr="2" direction="in">

View File

@ -11291,6 +11291,12 @@ private:
"}"); "}");
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
check("_Bool a[10];\n" // #10350
"void foo() {\n"
" memcpy(&a[5], &a[4], 2u * sizeof(a[0]));\n"
"}");
ASSERT_EQUALS("[test.cpp:3]: (error) Overlapping read/write in memcpy() is undefined behavior\n", errout.str());
// wmemcpy // wmemcpy
check("void foo() {\n" check("void foo() {\n"
" wchar_t a[10];\n" " wchar_t a[10];\n"