Skip to content

Commit

Permalink
Make sure valuess are used/copied before they are freed
Browse files Browse the repository at this point in the history
While reviewing  src/parser.y, I noticed that in a bunch of places
the code relied on arguments being evaluated in a certain order.

This seemingly is not currently causing problems, but with

  func(foo(jv_copy($1)), bar($1));
  func(foo(jv_string_value($1)), bar($1));

It is not guaranteed that jv_copy()/jv_string_value() is evaluated
before bar().
This patch splits those function calls into multiple statements to
ensures values are used/copied before they are freed where necessary.
  • Loading branch information
emanuele6 committed Jul 28, 2023
1 parent d319eb2 commit f478e45
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 102 deletions.
Loading

0 comments on commit f478e45

Please sign in to comment.