From e7ddd6b006ad924a3a6ec687a2f723c6e846bd34 Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Fri, 3 Mar 2023 17:16:12 +0800 Subject: [PATCH] fixed 2988dd4 from https://gitee.com/zhangrengao1/ark_ts2abc/pulls/898 Fix file of length over 260 on Windows of es2abc opt & merge parse Issue: I6JFN7 Signed-off-by: zhangrengao Change-Id: I83908ce323017d20004fa5fff1d0046d1a6b5d1e --- es2panda/util/helpers.cpp | 6 ++++-- merge_abc/src/main.cpp | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/es2panda/util/helpers.cpp b/es2panda/util/helpers.cpp index 72be34a1e8..19cfa5e393 100644 --- a/es2panda/util/helpers.cpp +++ b/es2panda/util/helpers.cpp @@ -450,12 +450,14 @@ bool Helpers::OptimizeProgram(panda::pandasm::Program * prog, es2panda::Compiler panda::Logger::Component::COMPILER; panda::Logger::InitializeStdLogging(panda::Logger::Level::ERROR, COMPONENT_MASK); - if (!panda::pandasm::AsmEmitter::Emit(options->output, *prog, statp, mapsp, true)) { + if (!panda::pandasm::AsmEmitter::Emit(panda::os::file::File::GetExtendedFilePath(options->output), *prog, statp, + mapsp, true)) { return false; } panda::bytecodeopt::options.SetOptLevel(options->optLevel); - panda::bytecodeopt::OptimizeBytecode(prog, mapsp, options->output, true, true); + panda::bytecodeopt::OptimizeBytecode(prog, mapsp, panda::os::file::File::GetExtendedFilePath(options->output), true, + true); #endif return true; } diff --git a/merge_abc/src/main.cpp b/merge_abc/src/main.cpp index 00c860a4e7..6df5188f8f 100644 --- a/merge_abc/src/main.cpp +++ b/merge_abc/src/main.cpp @@ -80,7 +80,8 @@ int Run(int argc, const char **argv) std::string outputFileName = outputFilePath.append(panda::os::file::File::GetPathDelim()). append(options->outputFileName()); - if (!panda::pandasm::AsmEmitter::EmitPrograms(outputFileName, programs, true)) { + if (!panda::pandasm::AsmEmitter::EmitPrograms(panda::os::file::File::GetExtendedFilePath(outputFileName), programs, + true)) { return 1; } -- Gitee