Constant initialized class instances do not have correct class metadata for up/down casting support

Bug #1297966 reported by Daniele Di Proietto
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cheerp
Fix Released
Medium
Alessandro Pignotti

Bug Description

I have a bug to report, but unfortunately I am still not able to reproduce it with a simple test case, so here it goes.

This revision of my software works fine with duetto:
https://github.com/ddiproietto/nontetris/commit/25b2dab412aaa71eeed4a9ec4acdb60cd19110f7

------------------------

However, the next commit
https://github.com/ddiproietto/nontetris/commit/172255ea9ff9f0c58980066d1b2dc6dce9cc9d59
introduces a weird bug: as soon as Box2D tries to report a collision the game stops working and the browser reports a javascript runtime error about Llistener.o not being defined in this line:

var tmp4725 = (Llistener.d[Llistener.o].a0);

You can see the problem in action here (when a piece reach a wall or the ground):

http://allievi.sssup.it/jacopone/cnontetris-testing/

------------------------

To avoid the problem I found an ugly simple fix for my code

https://github.com/ddiproietto/nontetris/commit/7879a417a98128090a5e3e27b783ca4f9f94ca01

that, surprisingly enough, works.

I'm sorry I wasn't able to investigate this further

Revision history for this message
Alessandro Pignotti (a-pignotti) wrote :

I've identified the bug. The issue is that constant initialized class instances do not have correct class metadata for up/down casting support. Changed the title accordingly.

summary: - Allocation object (which uses inheritance) statically causes pointer not
- to work
+ Constant initialized class instances do not have correct class metadata
+ for up/down casting support
Changed in duetto:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Alessandro Pignotti (a-pignotti)
Changed in cheerp:
status: Confirmed → Fix Committed
Changed in cheerp:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.