REBOL3 tracker
  0.9.12 beta
Ticket #0000711 User: anonymous

Project:



rss
TypeBug Statustested Date13-Apr-2009 04:10
Versionalpha 47 Categoryn/a Submitted byBrianH
PlatformAll Severitymajor Priorityhigh

Summary Weird error with PROTECT/hide and MAKE
Description It looks like MAKE has a bounds-check error with its spec when the first word of the prototype object has been hidden with PROTECT/hide, and the tail of the spec is a call of a bound function with a missing argument.

See the example, it's freaky. Noticed by Peta in the blog.
Example code
; Test 1: Field first
>> a: make object! [a: 1 b: func [c] [exit]]
== make object! [
    a: 1
    b: make function! [[c][exit]]
]

>> make a [set 'd b] d
** Script error: b is missing its c argument
** Where: make
** Near: make a [set 'd b]
; An error is the correct behavior

>> protect/hide in a 'a
== a

>> make a [set 'd b]
== make object! [
    b: make function! [[c][exit]]
]  ; Should be the same error

>> d
== 1  ; Should be unset

; Test 2: Field last
>> a: make object! [b: func [c] [exit] a: 1]
== make object! [
    b: make function! [[c][exit]]
    a: 1
]

>> protect in a 'a
== a

>> make a [set 'd b]
** Script error: b is missing its c argument
** Where: make
** Near: make a [set 'd b]
; An error is the correct behavior

; Test 3: External function
>> a: make object! [a: 1] b: func [c] [exit]
== make function! [[c][exit]]

>> protect in a 'a
== a

>> make a [set 'd b]
** Script error: b is missing its c argument
** Where: make
** Near: make a [set 'd b]
; An error is the correct behavior

Assigned ton/a Fixed inalpha 49 Last Update26-Apr-2009 10:15


Comments

Date User Field Action Change
26-Apr-2009 10:15 BrianH Status Modified built => tested
25-Apr-2009 14:47 carl Fixedin Modified => alpha 49
25-Apr-2009 14:47 carl Status Modified reviewed => built
13-Apr-2009 04:18 BrianH Description Modified -
13-Apr-2009 04:18 BrianH Code Modified -
13-Apr-2009 04:18 BrianH Status Modified submitted => reviewed
13-Apr-2009 04:10 BrianH Ticket Added -