Skip to content
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
19 changes: 4 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build

on:
push:
branches: [ main, feat/*, 3-feat-ci-add-build-workflow ]
branches: [ main, 3-feat-ci-add-build-workflow ]
pull_request:
branches: [ main ]
workflow_dispatch:
Expand All @@ -25,7 +25,7 @@ jobs:
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake
sudo apt-get install -y build-essential cmake python3
# Install LLVM and Clang 20
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-20 main"
Expand All @@ -37,7 +37,7 @@ jobs:
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install cmake llvm@20
brew install cmake python llvm@20
echo "LLVM_DIR=$(brew --prefix llvm@20)/lib/cmake/llvm" >> $GITHUB_ENV
echo "Clang_DIR=$(brew --prefix llvm@20)/lib/cmake/clang" >> $GITHUB_ENV
echo "$(brew --prefix llvm@20)/bin" >> $GITHUB_PATH
Expand All @@ -57,15 +57,4 @@ jobs:
- name: Test Stack Usage Analyzer (Linux/macOS)
if: runner.os == 'Linux' || runner.os == 'macOS'
run: |
cd build
# Create a test file with some stack usage
cat <<EOF > test_stack.c
#define SIZE_LARGE 1024
int main(void) {
char test[SIZE_LARGE];
return 0;
}
EOF

# Run the analyzer
./stack_usage_analyzer --mode=ir test_stack.c
python3 run_test.py
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ include(FetchContent)
FetchContent_Declare(
cc
GIT_REPOSITORY https://github.com/CoreTrace/coretrace-compiler.git
GIT_TAG main
GIT_TAG main
)

FetchContent_MakeAvailable(cc)
Expand Down
4 changes: 2 additions & 2 deletions test/vla/vla-scanf.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
int main(void)
{
int n;
// at line 9, column 9
// --- at line 9, column 9
// [!!] stack pointer escape: address of variable 'n' escapes this function
// address passed as argument to function 'scanf' (callee may capture the pointer beyond this function)
if (scanf("%d", &n) != 1)
return 1;

// at line 16, column 5
// --- at line 16, column 5
// [!] dynamic stack allocation detected for variable 'vla'
// allocated type: i8
// size of this allocation is not compile-time constant (VLA / variable alloca) and may lead to unbounded stack usage
Expand Down
Loading