[llvm-bugs] [Bug 47905] New: CFG regression in sqlite3 function tables after cfd8481da1adba1952e0f6ecd00440986e49a946

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Oct 19 10:03:33 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=47905

            Bug ID: 47905
           Summary: CFG regression in sqlite3 function tables after
                    cfd8481da1adba1952e0f6ecd00440986e49a946
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: dmajor at mozilla.com
                CC: andrew.paverd at microsoft.com, htmldeveloper at gmail.com,
                    llvm-bugs at lists.llvm.org, rnk at google.com

According to a comment in sqlite3, "Many system calls are accessed through
pointer-to-functions so that they may be overridden at runtime to facilitate
fault injection during testing and sandboxing."

This code pattern started being reported as an invalid call after
cfd8481da1adba1952e0f6ecd00440986e49a946:

t.c:

#include <windows.h>

typedef void (*sqlite3_syscall_ptr)(void);

sqlite3_syscall_ptr ptrs[] = { (sqlite3_syscall_ptr)GetSystemInfo, };

int main() {
  SYSTEM_INFO info;
  ((VOID(WINAPI*)(LPSYSTEM_INFO))ptrs[0])(&info);
  return 0;
}

Build with:
clang-cl -c -O2 -guard:cf t.c && lld-link -debug -guard:cf t.obj

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201019/8f49ffbc/attachment.html>


More information about the llvm-bugs mailing list