APPEND to object of block of odd length can crash #708
Labels
CC.resolved
Issue with CureCode status built, tested or complete
Datatype: object!
Oldes.resolved
Bugs/wishes with Oldes' fixes/features
Ren.important
Status.important
Test.written
Type.bug
Submitted by: Sunanda
REBOL System Error 1305; invalid data type 83
Imported from: CureCode [ Version: alpha 47 Type: Bug Platform: All Category: n/a Reproduce: Always Fixed-in:alpha 49 ]
Imported from: metaeducation#708
Comments:
Submitted by: BrianH
This is what I get when I enter your code in a fresh console:
bc.. >> append make object! [] reduce [a: 'x]
** Script error: invalid argument: frame!
** Where: append
** Near: append make object! [] [x]
p.
This is the wrong error - there is no frame! in that statement.
On a hunch I next try:
...and I get your crash error. This indicates that there is a bounds checking problem when you append a block with an odd number of values in it to an object.
APPEND to an object is supposed to add unset! when just a word! is appended, like this:
Clearly when the value portion is missing from APPEND of [name value], it just tries to use whatever is next in memory instead of assigning unset!. Depending on what is next in memory, that could crash the system or render it corrupt.
Upped the severity and priority accordingly.
This bug seems to be fixed, although there is different result when using block with word without value, or when used just a word:
I think that the result should be same... so having
none!
in the second case too.The text was updated successfully, but these errors were encountered: