Modify

Opened 14 years ago

Closed 12 years ago

#1566 closed Bug (Fixed)

Array as its own element issue

Reported by: trancexx Owned by: trancexx
Milestone: 3.3.9.3 Component: AutoIt
Version: 3.3.6.0 Severity: None
Keywords: Cc:

Description

Code is:

#include <Array.au3>

Global $a[3] = [1, 2, 3]
$a[1] = $a

; And then
$b = $a[1]
$c = $b[1]
$d = $c[1]
$e = $d[1]
$f = $e[1]
;...
_ArrayDisplay($a, "Displaying $a")
_ArrayDisplay($b, "Displaying $b")
_ArrayDisplay($c, "Displaying $c")
_ArrayDisplay($d, "Displaying $d")
_ArrayDisplay($e, "Displaying $e")
_ArrayDisplay($f, "Displaying $f")

If array (old) is put as some element of its own endless* recursion occurs. Expected would be $b to be 1, 2, 3.
Obvious workaround works as expected.

I tried to determine how deep it goes but my RAM was sucked up. 10000 here:

#AutoIt3Wrapper_Run_Au3check=n

	Global $0[3] = [1, 2, 3]
	$0[1] = $0

	$iMax = 10000 ; Probably 16000000 / 3 is the max
	For $i = 1 To $iMax
	Assign($i, Execute("$" & $i - 1 & "[1]"))
	Next
	_ArrayDisplay(Eval($iMax), "Displaying $" & $iMax)

If this is combined with Ticket #1565 AutoIt crashes (stack overflow).

$a = StringSplit("ab", "")
$a[1] = $a

$obj=ObjCreate("Scripting.Dictionary")
MsgBox(64, "", "It will crash now")
$obj.add("test", $a)

Attachments (0)

Change History (2)

comment:1 Changed 14 years ago by Jpm

  • Owner set to Jon
  • Status changed from new to assigned

comment:2 Changed 12 years ago by trancexx

  • Milestone set to 3.3.9.3
  • Owner changed from Jon to trancexx
  • Resolution set to Fixed
  • Status changed from assigned to closed

Fixed by revision [6885] in version: 3.3.9.3

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

Action
as closed The owner will remain trancexx.
Author


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

 
Note: See TracTickets for help on using tickets.