Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8311111

Suspicious casts in AccessBridgeATInstance.cpp

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 9, 11, 17, 20, 21, 22
    • client-libs
    • None

      Reported by clang:

      src\jdk.accessibility\windows\native\libjavaaccessbridge\AccessBridgeATInstance.cpp(150,54): warning: cast to 'void *' from smaller integer type 'DWORD' (aka 'unsigned long') [-Wint-to-void-pointer-cast]
          ret = (HANDLE) _beginthreadex(NULL,0,thread_func,(void *)param,0,(unsigned int *)id);
                                                           ^~~~~~~~~~~~~
      src\jdk.accessibility\windows\native\libjavaaccessbridge\AccessBridgeATInstance.cpp(200,94): warning: cast to smaller integer type 'unsigned long' from 'EVENT_STRUCT *' [-Wpointer-to-int-cast]
                  HANDLE JavaBridgeThreadHandle = BeginThread(JavaBridgeThread,&JavaBridgeThreadId,(DWORD)event_struct);
                                                                                                   ^~~~~~~~~~~~~~~~~~~

      The casts lose the top 32 bits of a pointer and may lead to a crash.

            abhiscxk Abhishek Kumar
            djelinski Daniel Jelinski
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: