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

ci(memory_leaks): Fix CI valgrind check and resolve function memory leaks #121

Merged
merged 1 commit into from
Feb 9, 2025

Conversation

SIGMazer
Copy link
Contributor

@SIGMazer SIGMazer commented Feb 8, 2025

Description

This pull request includes several important changes to memory management and testing procedures in the codebase. The changes focus on improving the handling of function parameters and enhancing the reliability of the test suite.

Memory management improvements:

  • ast.c: Added a call to free_parameters to ensure all function parameters are properly freed in free_ast.
  • ast.c: Added a call to SAFE_FREE for variables in enter_function_scope to prevent memory leaks.
  • ast.c: Added a call to reverse_parameter_list in enter_function_scope to ensure the parameter list is in the correct order.

Testing enhancements:

  • run_valgrind_tests.sh: Added a check for Valgrind errors and an exit command to stop the script if Valgrind detects any issues. This ensures that memory leaks and errors are caught during testing.

Related Issue

Fixes #<issue_number>

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Performance improvement
  • Refactor

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have documented my changes in the code or documentation
  • I have added tests that prove my changes work (if applicable)
  • I have run the unit tests locally
  • I have run the valgrind memory tests locally
  • All new and existing tests pass

@SIGMazer SIGMazer added CI Continuous integration bugfix Fix for something that wasn't working labels Feb 8, 2025
@SIGMazer SIGMazer requested a review from araujo88 as a code owner February 8, 2025 08:10
@SIGMazer SIGMazer changed the title ci(memoryl_leaks): Fix CI valgrind check and resolve function memory ci(memory_leaks): Fix CI valgrind check and resolve function memory Feb 8, 2025
@SIGMazer SIGMazer changed the title ci(memory_leaks): Fix CI valgrind check and resolve function memory ci(memory_leaks): Fix CI valgrind check and resolve function memory leaks Feb 8, 2025
@SIGMazer SIGMazer merged commit 7d4e49f into main Feb 9, 2025
2 checks passed
@SIGMazer SIGMazer deleted the ci/memoryl_leaks branch February 9, 2025 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fix for something that wasn't working CI Continuous integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants