Skip to content

Commit

Permalink
Merge branch 'master' of github.com:lailongwei/llbc
Browse files Browse the repository at this point in the history
  • Loading branch information
lailongwei committed Nov 2, 2023
2 parents fe21cbe + a1acc24 commit 0e9d7bd
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set(CMAKE_COLOR_MAKEFILE on)

# Disable min/max macro define(on MSVC compiler).
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOMINMAX"
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOMINMAX")
endif()

# Set llbc core lib directory.
Expand Down
20 changes: 10 additions & 10 deletions llbc/src/core/os/OS_Process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,18 +424,18 @@ int LLBC_HandleCrash(const LLBC_String &dumpFilePath,
if (LLBC_GetLastError() != LLBC_ERROR_SUCCESS)
return LLBC_FAILED;

// Write new core pattern.
// Write new core pattern(may not have permission to open core_pattern file, ignore error).
LLBC_File corePatternFile;
if (corePatternFile.Open(LLBC_INL_NS __corePatternPath, LLBC_FileMode::Write) != LLBC_OK)
return LLBC_FAILED;

// If failed, try write old core pattern.
if (corePatternFile.Write(dumpFilePath) != LLBC_OK)
if (corePatternFile.Open(LLBC_INL_NS __corePatternPath, LLBC_FileMode::Write) == LLBC_OK)
{
corePatternFile.Seek(LLBC_FileSeekOrigin::Begin, 0);
corePatternFile.Write(oldCorePattern);

return LLBC_FAILED;
// If failed, try write old core pattern.
if (corePatternFile.Write(dumpFilePath) != LLBC_OK)
{
corePatternFile.Seek(LLBC_FileSeekOrigin::Begin, 0);
corePatternFile.Write(oldCorePattern);

return LLBC_FAILED;
}
}
}

Expand Down
9 changes: 8 additions & 1 deletion tools/premake/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,14 @@ project "pyllbc"
string.gsub(llbc_output_dir, "/", "\\"),
pyllbc_testsuite_output_path_win))
filter { "system:not windows" }
-- Do nothing.
postbuildcommands(
string.format(
"\\cp -rf \"%s\"/libllbc*.so \"%s\"/",
llbc_output_dir, pyllbc_testsuite_output_path))
postbuildcommands(
string.format(
"\\cp -rf \"%s\"/llbc*.so \"%s\"/",
llbc_output_dir, pyllbc_testsuite_output_path))
filter {}

-- postbuild: Copy misc files.
Expand Down
2 changes: 1 addition & 1 deletion wrap/pyllbc/testsuite/app/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__author__ = 'Administrator'
# -*- coding: utf-8 -*-
3 changes: 0 additions & 3 deletions wrap/pyllbc/testsuite/common/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# -*- coding: utf-8 -*-
"""
"""


from testcase_llbcinfo import LLBCInfoTest
from testcase_stream import StreamTest

0 comments on commit 0e9d7bd

Please sign in to comment.