Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tons of crashing around ParamArray; ParamArray can only be Variant so shouldn't trigger warning #1610

Closed
fafalone opened this issue Jul 10, 2023 · 2 comments

Comments

@fafalone
Copy link
Collaborator

Describe the bug
I loaded a project from VB that uses a ParamArray argument for functions after a line continuation. This is causing tons of crashing; whenever the compiler so much as glances at the prototype.

To Reproduce
-New StdExe
-In Form1:

Private Function Invoke(ByVal pInterface As Long, _
                        ByVal vtb As vtb_Interfaces, _
                        ParamArray var()) As Variant
    If pInterface <> 0& Then
        Invoke = OleInvoke(pInterface, vtb, var)
    End If
End Function

Private Function OleInvoke(ByVal pInterface As Long, _
                           ByVal lngCmd As Long, _
                           ParamArray aParam()) As Variant
                           
End Function

Sub foo()
	Call Invoke(0, 0, 0)
End Sub

Right click Invoke, start typing out Invoke again, click the dropdown menu...

01:41:50.3630001 05:41:50.344 NATIVE EXCEPTION: ACCESS_VIOLATION {no-basic-code}
01:41:51.366 restarting from MEMORY [undefined]
01:41:53.231 received request_custom_applyEdit for file that isn't being edited: twinbasic:/NewProject/Sources/Form1.twin
01:41:53.369 0001 05:41:53.326 NATIVE EXCEPTION: ACCESS_VIOLATION {no-basic-code}
01:41:54.353 restarting from MEMORY [undefined]

and so on

Expected behavior
No crashy :)

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 10
  • twinBASIC compiler version 0.15.350

Additional context
Add any other context about the problem here.

@fafalone
Copy link
Collaborator Author

Also minor issue but since a paramarray can only be a variant, for now, 'datatype has not been explicitly declared so will default to Variant' isn't really appropriate.

@WaynePhillipsEA
Copy link
Collaborator

Both issues fixed in BETA 351. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants