diff --git a/libpandafile/pandafile_isapi.rb b/libpandafile/pandafile_isapi.rb index 011144dd9d..1108822d3b 100644 --- a/libpandafile/pandafile_isapi.rb +++ b/libpandafile/pandafile_isapi.rb @@ -62,15 +62,18 @@ def emitter_signature(group, is_jump) group.each do |insn| insn.operands.each_with_index do |o, i| sig[i].width = [o.width, sig[i].width].max + if o.is_signed_imm? || o.is_float_imm? + if is_jump + sig[i].type, sig[i].name = ['const Label &', 'label'] + else + sig[i].type = "int#{sig[i].width}_t" + end + else + sig[i].type = "uint#{sig[i].width}_t" + end end end - sig.each do |o| - if o.name.start_with?('imm') - o.type, o.name = is_jump ? ['const Label &', 'label'] : ["int#{o.width}_t", o.name] - else - o.type = "uint#{o.width}_t" - end - end + return sig end def insns_uniq_sort_fmts diff --git a/libpandafile/templates/bytecode_emitter_gen.h.erb b/libpandafile/templates/bytecode_emitter_gen.h.erb index 1cd46da345..91bd3dc9c2 100755 --- a/libpandafile/templates/bytecode_emitter_gen.h.erb +++ b/libpandafile/templates/bytecode_emitter_gen.h.erb @@ -83,10 +83,10 @@ void BytecodeEmitter::<%= emitter_name %>(<%= signature_str %>) { % signature.each do |arg| % v = '%s_bitlen' % arg.name % bitlen_vars.push(v) -% if arg.name.start_with?('imm') - auto <%= v %> = GetBitLengthSigned(<%= arg.name %>); -% else +% if arg.type.start_with?('u') auto <%= v %> = GetBitLengthUnsigned(<%= arg.name %>); +% else + auto <%= v %> = GetBitLengthSigned(<%= arg.name %>); % end % end % diff --git a/libpandafile/templates/tests/bytecode_emitter_tests_gen.h.erb b/libpandafile/templates/tests/bytecode_emitter_tests_gen.h.erb index 4a6cfea82a..65b31d39da 100644 --- a/libpandafile/templates/tests/bytecode_emitter_tests_gen.h.erb +++ b/libpandafile/templates/tests/bytecode_emitter_tests_gen.h.erb @@ -292,7 +292,7 @@ HWTEST(BytecodeEmitter, <%= emitter_name %>_<%= i.format.pretty.upcase %>_AUTO, % vals = [] % p.each_with_index do |v, index| % op = ops[index] -% is_signed = op.name.start_with?('imm') +% is_signed = i.operands[index].is_signed_imm? || i.operands[index].is_float_imm? % arg = v == 'min' ? get_min(op.width, is_signed) : get_max(op.width, is_signed) % args.push(arg) % if op.width <= 8 diff --git a/verifier/tests/verify_sys_hap_abc.py b/verifier/tests/verify_sys_hap_abc.py index e8587f303e..a649bca82e 100644 --- a/verifier/tests/verify_sys_hap_abc.py +++ b/verifier/tests/verify_sys_hap_abc.py @@ -19,6 +19,7 @@ import os import shutil import subprocess import zipfile +import shutil def parse_args(): @@ -127,6 +128,8 @@ def main(): for failed_abc in failed_abc_list: print(f" - {failed_abc}") + shutil.rmtree(out_folder) + if __name__ == "__main__": main()