summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2011-11-20 10:42:13 +0400
committerCyrill Gorcunov <gorcunov@gmail.com>2011-11-20 10:42:13 +0400
commit8a88750cd880cd830790e27d40f9e027d9b7f256 (patch)
treedd5129a8cd600c6c308b404e3bad0f4cec19e1f2
parentd96a329a78e07d60ad6200858bd7d28a7fbbe772 (diff)
downloadnasm-8a88750cd880cd830790e27d40f9e027d9b7f256.tar.gz
preproc: Proper bracing with list_for_each
It is a potential place for a bug if list_for_each helper is used with multiple lines of code without a proper bracing. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
-rw-r--r--preproc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/preproc.c b/preproc.c
index 76b0ac16..b21335e9 100644
--- a/preproc.c
+++ b/preproc.c
@@ -4461,9 +4461,10 @@ again:
* all, then think about checking for parameters if
* necessary.
*/
- list_for_each(m, head)
+ list_for_each(m, head) {
if (!mstrcmp(m->name, mname, m->casesense))
break;
+ }
if (m) {
mstart = tline;
params = NULL;
@@ -4827,9 +4828,10 @@ static ExpDef *is_mmacro(Token * tline, Token *** params_array)
* count the parameters, and then we look further along the
* list if necessary to find the proper ExpDef.
*/
- list_for_each(ed, head)
+ list_for_each(ed, head) {
if (!mstrcmp(ed->name, tline->text, ed->casesense))
break;
+ }
if (!ed)
return NULL;
@@ -4882,9 +4884,10 @@ static ExpDef *is_mmacro(Token * tline, Token *** params_array)
* This one wasn't right: look for the next one with the
* same name.
*/
- list_for_each(ed, ed->next)
+ list_for_each(ed, ed->next) {
if (!mstrcmp(ed->name, tline->text, ed->casesense))
break;
+ }
}
/*