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>
<returnValue type="HRESULT"/>
<leak-ignore/>
<arg nr="1" direction="in">
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="2" direction="in">
@ -3432,7 +3432,7 @@ HFONT CreateFont(
<arg nr="9" direction="in">
<not-uninit/>
</arg>
<arg nr="10" direction="in">
<arg nr="10">
<not-uninit/>
</arg>
<arg nr="11" direction="in">
@ -3487,7 +3487,7 @@ HFONT CreateFont(
<arg nr="10" direction="in">
<not-uninit/>
</arg>
<arg nr="11" direction="in">
<arg nr="11">
<not-uninit/>
</arg>
<arg nr="12" direction="in">
@ -3501,7 +3501,7 @@ HFONT CreateFont(
<noreturn>false</noreturn>
<returnValue type="BOOL"/>
<leak-ignore/>
<arg nr="1" direction="in">
<arg nr="1">
<not-null/>
<not-uninit/>
</arg>
@ -4726,7 +4726,7 @@ HFONT CreateFont(
<returnValue type="HMODULE"/>
<use-retval/>
<leak-ignore/>
<arg nr="1" direction="in">
<arg nr="1">
<not-uninit/>
<strz/>
</arg>
@ -4806,7 +4806,7 @@ HFONT CreateFont(
<function name="FreeLibraryAndExitThread">
<noreturn>true</noreturn>
<returnValue type="VOID"/>
<arg nr="1" direction="in">
<arg nr="1">
<not-uninit/>
<not-bool/>
</arg>
@ -4821,7 +4821,7 @@ HFONT CreateFont(
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="DWORD"/>
<arg nr="1" direction="in">
<arg nr="1">
<not-uninit/>
<not-bool/>
</arg>
@ -5646,7 +5646,7 @@ HFONT CreateFont(
<returnValue type="int"/>
<leak-ignore/>
<!-- 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/>
</arg>
<arg nr="2" direction="out">
@ -6791,7 +6791,7 @@ HFONT CreateFont(
<returnValue type="HWND"/>
<use-retval/>
<leak-ignore/>
<arg nr="1" direction="in">
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="2" direction="in">

View File

@ -11291,6 +11291,12 @@ private:
"}");
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
check("void foo() {\n"
" wchar_t a[10];\n"