diff options
| author | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2009-04-27 08:19:25 +0000 |
|---|---|---|
| committer | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2009-04-27 08:19:25 +0000 |
| commit | 86b97760e6202533fc87777f75cc4b95c594ec44 (patch) | |
| tree | 8f1171afa030dfc282d7d50f0f59c24c73a3b854 | |
| parent | 4ba02b07253ddde0619e5a45df6aa431f1985352 (diff) | |
fix: handle non-LHS argument for lasso_extract_node_or_fail()
* lasso/utils.h:
create a temporary varaible to store result of second argument
evaluation to prevent spurious side effects.
| -rw-r--r-- | lasso/utils.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lasso/utils.h b/lasso/utils.h index 1f0e9239..7f2adce0 100644 --- a/lasso/utils.h +++ b/lasso/utils.h @@ -317,11 +317,14 @@ /* Node extraction */ #define lasso_extract_node_or_fail(to, from, kind, error) \ - if (LASSO_IS_##kind(from)) { \ - to = LASSO_##kind(from); \ - } else { \ - rc = error; \ - goto cleanup; \ + {\ + void *__tmp = (from); \ + if (LASSO_IS_##kind(__tmp)) { \ + to = LASSO_##kind(__tmp); \ + } else { \ + rc = error; \ + goto cleanup; \ + }\ } /* Bad param handling */ |
