# Copyright (c) 2021-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. .record panda.ArrayIndexOutOfBoundsException .function i32 check() { movi v0, 10 newarr v0, v0, i32[] movi v1, 11 movi v2, 0 try_begin_label_0: call.short can_throw, v0, v1 try_end_label_0: movi v2, 0 jmp jump_label catch_block1_begin: jump_label: lda v2 return .catch panda.ArrayIndexOutOfBoundsException, try_begin_label_0, try_end_label_0, catch_block1_begin } .function void can_throw(i32[] a0, i32 a1) { mov.obj v0, a0 mov v1, a1 movi v2, 0x0 lda v2 starr v0, v1 return.void } .function i32 main() { call.short check return }