fix: correct memory deallocation in JitExecutor by using delete[] for… #15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "CI tests" | |
| on: [ push, workflow_dispatch ] | |
| jobs: | |
| style-check: | |
| name: Code style check with clang-format | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install clang-format | |
| run: | | |
| sudo apt-get update && sudo apt-get -y install clang-format | |
| - name: Check code style | |
| shell: bash | |
| run: | | |
| mapfile -t files < <(git ls-files '*.c' '*.cpp' '*.h' '*.hpp') | |
| if [ "${#files[@]}" -eq 0 ]; then | |
| echo "No C/C++ files to check." | |
| exit 0 | |
| fi | |
| clang-format --dry-run --Werror "${files[@]}" 2>format_output.txt || { | |
| cat format_output.txt | |
| exit 1 | |
| } | |
| - name: Comment on style issues | |
| if: failure() && github.event_name == 'pull_request' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const fs = require('fs'); | |
| const { execSync } = require('child_process'); | |
| try { | |
| // Get list of files that need formatting | |
| const rawFiles = execSync('git ls-files "*.c" "*.cpp" "*.h" "*.hpp"', { encoding: 'utf8' }).trim(); | |
| if (!rawFiles) { | |
| console.log('No files require formatting checks.'); | |
| return; | |
| } | |
| const files = rawFiles.split('\n'); | |
| let comment = '## 🎨 Code Style Issues Found\n\n'; | |
| comment += 'The following files have formatting issues:\n\n'; | |
| let hasIssues = false; | |
| for (const file of files) { | |
| try { | |
| const result = execSync(`clang-format --dry-run --Werror "${file}" 2>&1`, { encoding: 'utf8' }); | |
| } catch (error) { | |
| comment += `- \`${file}\`: Formatting issues detected\n`; | |
| hasIssues = true; | |
| } | |
| } | |
| if (!hasIssues) { | |
| comment += 'No files with formatting issues were detected.'; | |
| } else { | |
| comment += '\nPlease run `clang-format -i <file>` to fix formatting issues.'; | |
| } | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: comment | |
| }); | |
| } catch (error) { | |
| console.log('Could not create comment:', error.message); | |
| } |