Интерпретатор
Основной коммит: c604b9d22, фронтенд коммит: 2fe0345fb
Все шаги для воспроизведения сохранены в лог-файле
method_instance_static_declaration_0040.ets
/*
* Copyright (c) 2021-2024 Huawei Device Co., Ltd.
* Лицензировано по лицензии Apache версии 2.0 ("Лицензия");
* вы можете использовать этот файл только в соответствии с Лицензией.
* Вы можете получить копию Лицензии по адресу
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Кроме случаев, предусмотренных применимым законом или письменно согласованного, программное обеспечение
* распространяемое по Лицензии предоставляется «КАК ЕСТЬ», БЕЗ КАКИХ-ЛИБО ГАРАНТИЙ ИЛИ УСЛОВИЙ, как явленных, так и подразумеваемых.
* Смотрите Лицензию для конкретного языка, регулирующего права и
* ограничения по Лицензии.
*/
/*---
desc: 9.6 Статический и экземпляр с одинаковым названием
name: 09.classes/09.06.method_declarations/
tags: []
spec: 9.6
---*/
class Y {
public yy: int
public foo(): int { return this.yy * 3 }
public bar(): int { return this.yy * 2 }
constructor(yy: int) {
this.yy = yy
}
}
class Y2 {
public yy2: int
public foo(): int { return this.yy2 * 3 }
public bar(): int { return this.yy2 * 2 }
constructor(yy2: int) {
this.yy2 = yy2
}
}
class X {
public foo(p: Y, p2: Y2): number { return p.foo() + p2.foo() }
static foo(p: Y, p2: Y2): number { return p.bar() + p2.bar() }
}
function main(): int {
let y: Y = new Y(6)
let y2: Y2 = new Y2(6)
let x: X = new X()
assert(x.foo(y, y2) === 36)
assert(X.foo(y, y2) === 24)
return 0
}
method_instance_static_declaration_0040.ets.report-1721133021.log```
spec/09.classes/9.6.Method_Declarations/method_instance_static_declaration_0040.ets
/tmp/ets/gen/spec/09.classes/9.6.Method_Declarations/method_instance_static_declaration_0040.ets
Результат: ОШИБКА
Время выполнения: 3,2 сек
Шаги воспроизведения:
/home/alex/projects/ohos/arkcompiler/runtime_core/static_core/build/bin/es2panda --arktsconfig=/home/alex/projects/ohos/arkcompiler/runtime_core/static_core/build/tools/es2panda/generated/arktsconfig.json --gen-stdlib=false --extension=ets --opt-level=2 --output=/tmp/ets/intermediate/spec/09.classes/9.6.Method_Declarations/method_instance_static_declaration_0040.ets.abc /tmp/ets/gen/spec/09.classes/9.6.Method_Declarations/method_instance_static_declaration_0040.ets
Для воспроизведения с использованием URunner запустите:
/home/alex/projects/ohos/arkcompiler/runtime_core/static_core/tests/tests-u-runner/runner.sh --ets-func-tests --processes=6 --build-dir="/home/alex/projects/ohos/arkcompiler/runtime_core/static_core/build" --work-dir="/tmp/ets" --verbose=all --verbose-filter=all --es2panda-timeout=30 --disable-verifier --verifier-timeout=30 --timeout=180 --test-file="spec/09.classes/9.6.Method_Declarations/method_instance_static_declaration_0040.ets" --force-generate --compare-files-iterations=2
Ожидаемый вывод:Реальный выход (стандартный вывод): Актуальная ошибка (stderr):
Указание не имеет операнда с таким индексом
ПРОВЕРКА НЕ УДОВЛЕТВОРЯЕТ: HasVReg(format, idx)
В libpandafile/include/bytecode_instruction-inl_gen.h:817: GetVReg
Отладочная трассировка [tid=42565]:
#0 : 0x7f9e9d3b3046 ark::PrintStack(std::ostream&)
в /home/alex/projects/ohos/arkcompiler/runtime_core/static_core/build/../libpandabase/os/stacktrace.h:50
#1 : 0x7f9e9d3b2faf ark::debug::AssertionFail(char const*, char const*, unsigned int, char const*)
в /home/alex/projects/ohos/arkcompiler/runtime_core/static_core/build/../libpandabase/utils/debug.cpp:35
#2 : 0x7f9e9c7cea49 unsigned short ark::BytecodeInst<(ark::BytecodeInstMode)0>::GetVReg<ark::BytecodeInst<(ark::BytecodeInstMode)0>::Opcode>(unsigned long) const
в /home/alex/projects/ohos/arkcompiler/runtime_core/static_core/build/libpandafile/include/bytecode_instruction-inl_gen.h:817
#3 : 0x7f9e9c7ab00d ark::compiler::InstBuilder::GetArgDefinition(ark::BytecodeInst<(ark::BytecodeInstMode)0> const*, unsigned long, bool, bool)
в /home/alex/projects/ohos/arkcompiler/runtime_core/static_core/build/../compiler/../optimizer/ir_builder/inst_builder-inl.h:533
#4 : 0x7f9e9c7da308 void ark::compiler::InstBuilder::SetCallArgs<ark::compiler::CallInst>(ark::BytecodeInst<(ark::BytecodeInstMode)0> const*, bool, bool, ark::compiler::Inst*, ark::compiler::CallInst*, ark::compiler::Inst*, ark::compiler::SaveStateInst*, bool, unsigned int, ark::compiler::Inst*)
в /home/alex/projects/ohos/arkcompiler/runtime_core/static_core/build/../compiler/../optimizer/ir_builder/inst_builder-inl.h:128
#5 : 0x7f9e9c7d87c2 void ark::compiler::InstBuilder::BuildCall<(ark::compiler::Opcode)94>(ark::BytecodeInst<(ark::BytecodeInstMode)0> const*, bool, bool, ark::compiler::Inst*)
в /home/alex/projects/ohos/arkcompiler/runtime_core/static_core/build/../compiler/../optimizer/ir_builder/inst_builder-inl.h:53
#6 : 0x7f9e9c7b7eac ark::compiler::InstBuilder::BuildInstruction(ark::BytecodeInst<(ark::BytecodeInstMode)0> const*)
в /home/alex/projects/ohos/arkcompiler/runtime_core/static_core/build/compiler/generated/inst_builder_gen.cpp:1312#7 : 0x7f9e9c4b673f bool ark::compiler::IrBuilder::BuildInstructionsForBB<false>(ark::compiler::BasicBlock*, ark::compiler::InstBuilder*, unsigned char const*)
в /home/alex/projects/ohos/arkcompiler/runtime_core/static_core/build/../compiler/optimizer/ir_builder/ir_builder.cpp:248
#8 : 0x7f9e9c4a9ecb ark::compiler::IrBuilder::BuildBasicBlock(ark::compiler::BasicBlock*, ark::compiler::InstBuilder*, unsigned char const*)
в /home/alex/projects/ohos/arkcompiler/runtime_core/static_core/build/../compiler/optimizer/ir_builder/ir_builder.cpp:211
#9 : 0x7f9e9c4a86eb ark::compiler::IrBuilder::RunImpl()
в /home/alex/projects/ohos/arkcompiler/runtime_core/static_core/build/../compiler/optimizer/ir_builder/ir_builder.cpp:56
#10: 0x7f9e9c58b1dc ark::compiler::Pass::Run()
в /home/alex/projects/ohos/arkcompiler/runtime_core/static_core/build/../compiler/optimizer/pass.cpp:25
#11: 0x7f9e9c58c98d ark::compiler::PassManager::RunPass(ark::compiler::Pass*, unsigned long)
в /home/alex/projects/ohos/arkcompiler/runtime_core/static_core/build/../compiler/optimizer/pass_manager.cpp:180
#12: 0x7f9e9cde1501 bool ark::compiler::PassManager::RunPass<ark::compiler::IrBuilder>()
в /home/alex/projects/ohos/arkcompiler/runtime_core/static_core/build/../compiler/optimizer/pass_manager.h:106
#13: 0x7f9e9cddc768 bool ark::compiler::Graph::RunPass<ark::compiler::IrBuilder>()
в /home/alex/projects/ohos/arkcompiler/runtime_core/static_core/build/../compiler/optimizer/ir/graph.h:835
#14: 0x7f9e9cdc654d ark::bytecodeopt::OptimizeFunction(ark::pandasm::Program*, ark::pandasm::AsmEmitter::PandaFileToPandaAsmMaps const*, ark::panda_file::MethodDataAccessor const&, bool, ark::SourceLanguage)
в /home/alex/projects/ohos/arkcompiler/runtime_core/static_core/build/../bytecode_optimizer/optimize_bytecode.cpp:290
#15: 0x7f9e9cdc6c08 operator()
в /home/alex/projects/ohos/arkcompiler/runtime_core/static_core/build/../bytecode_optimizer/optimize_bytecode.cpp:346
#16: 0x7f9e9cdc75d7 EnumerateClassElements<ark::bytecodeopt::OptimizePandaFile(ark::pandasm::Program*, const ark::pandasm::AsmEmitter::PandaFileToPandaAsmMaps*, const std::string&, bool)::<lambda(ark::panda_file::MethodDataAccessor&)>>
в /home/alex/projects/ohos/arkcompiler/runtime_core/static_core/build/../libpandafile/class_data_accessor-inl.h:172 #17: 0x7f9e9cdc70df EnumerateMethods<ark::bytecodeopt::OptimizePandaFile(ark::pandasm::Program*, const ark::pandasm::AsmEmitter::PandaFileToPandaAsmMaps*, const std::string&, bool)::<lambda(ark::panda_file::MethodDataAccessor&)>>
в /home/alex/projects/ohos/arkcompiler/runtime_core/static_core/build/../libpandafile/class_data_accessor-inl.h:198
#18: 0x7f9e9cdc6f23 ark::bytecodeopt::OptimizePandaFile(ark::pandasm::Program*, ark::pandasm::AsmEmitter::PandaFileToPandaAsmMaps const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool)
в /home/alex/projects/ohos/arkcompiler/runtime_core/static_core/build/../bytecode_optimizer/optimize_bytecode.cpp:344
#19: 0x7f9e9cdc7029 ark::bytecodeopt::OptimizeBytecode(ark::pandasm::Program*, ark::pandasm::AsmEmitter::PandaFileToPandaAsmMaps const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, bool)
в /home/alex/projects/ohos/arkcompiler/runtime_core/static_core/build/../bytecode_optimizer/optimize_bytecode.cpp:364
#20: 0x7f9e9f2804dd OptimizeBytecode
в /home/alex/projects/ohos/arkcompiler/runtime_core/static_core/build/../tools/es2panda/util/generateBin.cpp:54
#21: 0x7f9e9f280d98 ark::es2panda::util::GenerateProgram(ark::pandasm::Program*, ark::es2panda::util::Options const*, std::function<void(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)>) const&
в /home/alex/projects/ohos/arkcompiler/runtime_core/static_core/build/../tools/es2panda/util/generateBin.cpp:111
#22: 0x100042cb1 ? ? :? ?
#23: 0x100043721 ? ? :? ?
#24: 0x1000437b3 main+0x40
#25: 0x7f9e9cf07083 __libc_start_main+0xf3
#26: 0x1000428fe _start+0x2e
Актуальный код возврата:
-6
Вход Перед тем как оставить комментарий