mirror of
https://github.com/luau-lang/luau.git
synced 2024-11-16 06:45:44 +08:00
34cf695fbc
- A series of major optimizations to type checking performance on complex programs/types (up to two orders of magnitude speedup for programs involving huge tagged unions) - Fix a few issues encountered by UBSAN (and maybe fix s390x builds) - Fix gcc-11 test builds - Fix a rare corner case where luau_load wouldn't wake inactive threads which could result in a use-after-free due to GC - Fix CLI crash when error object that's not a string escapes to top level
20 lines
664 B
Python
20 lines
664 B
Python
# This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
|
|
|
class VariantPrinter:
|
|
def __init__(self, val):
|
|
self.val = val
|
|
|
|
def to_string(self):
|
|
typeId = int(self.val['typeId'])
|
|
type = self.val.type.template_argument(typeId)
|
|
value = self.val['storage'].reinterpret_cast(type.pointer()).dereference()
|
|
return type.name + " [" + str(value) + "]"
|
|
|
|
def match_printer(val):
|
|
type = val.type.strip_typedefs()
|
|
if type.name and type.name.startswith('Luau::Variant<'):
|
|
return VariantPrinter(val)
|
|
return None
|
|
|
|
gdb.pretty_printers.append(match_printer)
|