Opened 4 years ago

Last modified 4 years ago

#3165 new Bug

Call() function called with an empty array results in APPCRASH

Reported by: Rnde Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Call, Ubound, Array Cc:


AutoIt3.exe APPCRASH error upon calling Ubound() via Call():

Local $array[0]
$n = Call("Ubound", $array)

Attachments (0)

Change History (3)

comment:1 Changed 4 years ago by BrewManNH

  • Summary changed from Ubound() called with Call() function on 0-sized arrays results in APPCRASH to Call() function called with an empty array results in APPCRASH

You need to put the argument for the UBound inside quotes, otherwise you're not telling the function to use UBound on the array, you're telling the Call function that you're sending it an array of parameters, and because there are no parameters it crashes.

Local $array[0]
$n = Call("UBound", "$array")

It's a bug that it crashes because of this, but the bug is not what you think it is.

I've corrected the title of the bug report to reflect the actual bug condition.

comment:2 Changed 4 years ago by Rnde

I have tried your suggested method, it always returns 0 regardless the array's size.

Local $array[] = [1,2,3]
$n = Call("UBound", "$array")

comment:3 Changed 4 years ago by BrewManNH

When I run that I get an error message telling me that $array isn't an array or a map, it's possible that you can't use UBound in Call for some reason.

I'd avoid using Call at all if possible, it's almost never needed, and with this example definitely isn't.
But that's beside the point in this instance as I don't know if there's a bug in Ubound or a bug in using Call with UBound.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as new The ticket will remain with no owner.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.