compiler: restore exception ids used

This commit is contained in:
abdul124 2024-08-23 12:12:00 +08:00 committed by Sébastien Bourdeauducq
parent 5463d66dcd
commit 808d9c8004
6 changed files with 11 additions and 20 deletions

View File

@ -92,6 +92,7 @@ class EmbeddingMap:
# The exceptions declared here must be defined in `artiq.coredevice.exceptions` # The exceptions declared here must be defined in `artiq.coredevice.exceptions`
# Verify synchronization by running the test cases in `artiq.test.coredevice.test_exceptions` # Verify synchronization by running the test cases in `artiq.test.coredevice.test_exceptions`
self.preallocate_runtime_exception_names([ self.preallocate_runtime_exception_names([
"0:RuntimeError",
"RTIOUnderflow", "RTIOUnderflow",
"RTIOOverflow", "RTIOOverflow",
"RTIODestinationUnreachable", "RTIODestinationUnreachable",
@ -99,20 +100,10 @@ class EmbeddingMap:
"I2CError", "I2CError",
"CacheError", "CacheError",
"SPIError", "SPIError",
"SubkernelError", "0:ZeroDivisionError",
"0:AssertionError",
"0:AttributeError",
"0:IndexError", "0:IndexError",
"0:IOError", "UnwrapNoneError",
"0:KeyError", "SubkernelError",
"0:NotImplementedError",
"0:OverflowError",
"0:RuntimeError",
"0:TimeoutError",
"0:TypeError",
"0:ValueError",
"0:ZeroDivisionError"
]) ])
def preallocate_runtime_exception_names(self, names): def preallocate_runtime_exception_names(self, names):

View File

@ -8,7 +8,7 @@ def catch(f):
except Exception as e: except Exception as e:
print(e) print(e)
# CHECK-L: 19(0, 0, 0) # CHECK-L: 8(0, 0, 0)
catch(lambda: 1/0) catch(lambda: 1/0)
# CHECK-L: 10(10, 1, 0) # CHECK-L: 9(10, 1, 0)
catch(lambda: [1.0][10]) catch(lambda: [1.0][10])

View File

@ -10,7 +10,7 @@ def catch(f):
except IndexError as ie: except IndexError as ie:
print(ie) print(ie)
# CHECK-L: 19(0, 0, 0) # CHECK-L: 8(0, 0, 0)
catch(lambda: 1/0) catch(lambda: 1/0)
# CHECK-L: 10(10, 1, 0) # CHECK-L: 9(10, 1, 0)
catch(lambda: [1.0][10]) catch(lambda: [1.0][10])

View File

@ -3,7 +3,7 @@
# REQUIRES: exceptions # REQUIRES: exceptions
def f(): def f():
# CHECK-L: Uncaught 19 # CHECK-L: Uncaught 8
# CHECK-L: at input.py:${LINE:+1}: # CHECK-L: at input.py:${LINE:+1}:
1/0 1/0

View File

@ -9,7 +9,7 @@ def g():
try: try:
f() f()
except Exception as e: except Exception as e:
# CHECK-L: Uncaught 19 # CHECK-L: Uncaught 8
# CHECK-L: at input.py:${LINE:+1}: # CHECK-L: at input.py:${LINE:+1}:
raise e raise e

View File

@ -2,6 +2,6 @@
# RUN: OutputCheck %s --file-to-check=%t # RUN: OutputCheck %s --file-to-check=%t
# REQUIRES: exceptions # REQUIRES: exceptions
# CHECK-L: Uncaught 19: cannot divide by zero (0, 0, 0) # CHECK-L: Uncaught 8: cannot divide by zero (0, 0, 0)
# CHECK-L: at input.py:${LINE:+1}: # CHECK-L: at input.py:${LINE:+1}:
1/0 1/0