Skip to content

resolver/parser bug: addressof should have identifierreference created for referenced procedure #1326

@ghost

Description

Here's some example code:

Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" ( _
      ByVal lpPrevWndFunc As Long, _
      ByVal hwnd As Long, _
      ByVal msg As Long, _
      ByVal wParam As Long, _
      ByVal lParam As Long) _
      As Long

Sub CallbackTest2()
   CallWindowProc AddressOf CallbackMsg, 0, 0, 0, 0
End Sub

Public Function CallbackMsg _
      (msg As String, _
      ByVal nUnused1 As Long, _
      ByVal nUnused2 As Long, _
      ByVal nUnused3 As Long)

   MsgBox "CallBack Work :)" & msg
End Function

CallbackMsgshould have an identifierreference created for it but it doesn't (because it is used in the AddressOf expression in the CallbackTest2method). Possible reason: addressof is treated specially in the parser.

Example code taken from http://stackoverflow.com/questions/24997849/vba-addressof-crash-office-app.

@retailcoder If the parser should be changed, let me know and I'll take care of it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    antlrIssue is easier to resolve with knowledge of Antlr4bugIdentifies work items for known bugsparse-tree-processing

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions