boxer-project / boxer-sunrise

Sunrise on the Boxer Reconstruction Project
BSD 3-Clause "New" or "Revised" License
45 stars 2 forks source link

Lisp exception when executing a doit box that contains a transparent sprite box #104

Open rigdern opened 3 months ago

rigdern commented 3 months ago

Repro steps

I reproed this with Boxer 3.4.19 2024-06-24.

  1. Create a doit box named go
  2. Inside of the doit box, create a sprite box with option-s
  3. Make the sprite box transparent by putting the cursor inside of it and choosing the "Box > Export Names" menu item.
  4. Give the doit box something trivial to return by making its last line 0
  5. Outside of the doit box, write a new line with just go on it
  6. Eval that line to run go

Unexpected result: A Common Lisp exception is thrown:

Lisp Error:
  #(BOXER::VALID-VALUE-BOX-INTERFACE 0.0 #<DATA-BOX 0.00 > #<DATA-BOX  [] [] []... > BOXER::X-POSITION)
  fell through ETYPECASE expression inside BOXER:VIRTUAL-COPY.
Wanted one of (BOXER:VIRTUAL-COPY BOXER::VIRTUAL-PORT BOXER::BOX NUMBER SYMBOL BOXER::FOREIGN-DATA).

Alternately, you can repro the issue with doit box with transparent sprite repro.box.zip. Screenshot:

image
sgithens commented 2 months ago

I took an initial triage/look at this, and in defun virtual-copy added a case for simple-vector which simple returns itself, which seems to work for this a few other conditions I tried, but because vc affects a number of things this needs to be thought through a bit more, and it also dovetails with some of our other current quandries like "what should happen if you evaluate a sprite or graphics box" and "should it be possible to flip them to doit boxes or not".

If after some more testing and work through, this looks ok, I'll go ahead and commit it to at least resolve this crash for now.