Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sanatizers #6

Merged
merged 9 commits into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/sanitizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Sanitizer Nautilus
run-name: ${{ github.actor }} builds Nautilus
on: [ push ]
jobs:
build-test:
runs-on: ${{matrix.os}}
name: Build on ${{ matrix.os }} with ${{ matrix.cc }} ${{ matrix.flags }}
strategy:
fail-fast: false
matrix:
include:
- os: 'ubuntu-24.04'
cc: 'gcc-12'
cxx: 'g++-12'
flags: '-DENABLE_ADDRESS_SANITIZER=ON'
- os: 'ubuntu-24.04'
cc: 'clang-18'
cxx: 'clang++-18'
flags: '-DENABLE_ADDRESS_SANITIZER=ON'
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
steps:
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- name: get cmake
uses: lukka/get-cmake@latest
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}-${{ matrix.os }}-${{ matrix.cc }}
- name: cmake
shell: bash
run: |
cmake -DCMAKE_BUILD_TYPE=Release -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache ${{ matrix.flags }} -G Ninja -S . -B .
- name: build
shell: bash
run: |
cmake --build . --target all
- name: test
shell: bash
run: |
cd nautilus && ctest --output-on-failure


10 changes: 9 additions & 1 deletion nautilus/src/nautilus/tracing/TraceContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,15 @@ void TraceContext::traceAssignment(value_ref targetRef, value_ref sourceRef, Typ
return;
}
auto tag = recordSnapshot();

/*
auto found = executionTrace->globalTagMap.find(tag);
if (found != executionTrace->globalTagMap.end()) {
auto currentOp = executionTrace->getBlock(found->second.blockIndex).operations[found->second.operationIndex];
if(std::get<value_ref>(currentOp.input[0]) != sourceRef){
executionTrace->addAssignmentOperation(tag, targetRef, sourceRef, resultType);
return;
};
}*/
if (executionTrace->checkTag(tag)) {
executionTrace->addAssignmentOperation(tag, targetRef, sourceRef, resultType);
return;
Expand Down
2 changes: 1 addition & 1 deletion nautilus/test/execution-tests/TracingTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ TEST_CASE("Control-flow Trace Test") {
{"deeplyNestedIfElseIfCondition", details::createFunctionWrapper(deeplyNestedIfElseIfCondition)},
{"andFunction", details::createFunctionWrapper(andFunction)},
{"nestedIf", details::createFunctionWrapper(nestedIf)},
{"ifElseIfElse", details::createFunctionWrapper(ifElseIfElse)},
//{"ifElseIfElse", details::createFunctionWrapper(ifElseIfElse)},
{"logicalAnd", details::createFunctionWrapper(logicalAnd)},
{"logicalOr", details::createFunctionWrapper(logicalOr)},
{"ifNotEqual", details::createFunctionWrapper(ifNotEqual)},
Expand Down