[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: [luajit] deep inspection on lightuserdata identity test?
- From: Daniel Klein <daniel.klein@...>
- Date: Fri, 4 Nov 2011 08:18:06 -0400
We ran into an interesting situation while working with LuaJIT 2.0.0-beta8:
> require 'cdlua'
> =cd.GREEN == cd.GREEN
> =cd.GREEN == cd.BLUE
PANIC: unprotected error in call to Lua API (4.4562912041821e-313)
This is using the CD library from tecgraf, and the cd.X are lightuserdata objects.
We're running Windows 7, x64 and the crash happens with beta8 and HEAD and with the JIT turned off and no optimisations enabled (-joff -O0)
I suspect this means that if the pointers are equal, the result comes back quickly, but if they're not there's some deep inspection of the pointers happening, and I wouldn't have expected that. In regular Lua, the result comes back as I would expect (false) and doesn't crash.
I haven't been able to track down exactly where this sort of thing is resolved (lj_obj.c?), so my question -- Is this expected behaviour or a bug?
Daniel M. Klein
s/w dev, Tornado Medical Systems, Inc.
NOTICE OF CONFIDENTIAL AND PRIVILEGED INFORMATION
This e-mail message, including any attachments, may contain information that is
confidential, privileged, subject to copyright, or exempt from disclosure. Any
unauthorized distribution, disclosure, copying, review, retransmission or other use
of or reliance on this information may be unlawful and is strictly prohibited. You
may contact us at: firstname.lastname@example.org