Define does something malicious


The this script displaces the upvar and makes a block with an upvar only/an infinite variable
note:i used my own spec pack(only changing the specs in objects.js) forked from jmoenig/Snap so its not a mod problem


define upvar puts back deleted definitions


The first bug reproduces(literally)
(actually not a bug lol)

@jens Critical bug

@simplesi
@cymplecy

edit:

Also:


This can be used for a memory leak
edit:define already does that
hUUUUUUUUUUUUUUUge memory leak

also i used that delete hack to get rid of that script and this happened

aaaand this happened which is not expected

the function hat did not dissappear

This is the weirdest thing ever in Snap !

yeah with metaprogramming
in the code you are actually modifying a function when its running so its wormy

Jens is on vacation for a week so don't expect an immediate response, but thank you.

This is the experiment you can try: Snap! This is so weird (berkeley.edu)

oh ok

i wouldn't call that a critical bug, as the spewed out upvar returns to normal when you reload the project, and you can avoid it by not touching it.

i mean... i'm pretty sure this is what define is intended to do. i don't think they're going to change it. you can just not make a loop that defines a bunch of blocks.

and you could also create a memory "leak" by making a clone script that makes a bunch of clones. and this isn't a memory leak anyway -- that's when there's memory allocated that isn't known by the program.

You can even make this???
This is so weird script pic

I found something weirder. Do these steps above, then:

  1. Right-click the "this script" upvar (not the latter "this script"), then choose "ringify"
  2. Take out the ring.
  3. Then the resulting upvar is weird.
  4. If you run the block, Snap! freezes, but will not crash.