summaryrefslogtreecommitdiff
path: root/giscanner/scannerparser.y
diff options
context:
space:
mode:
Diffstat (limited to 'giscanner/scannerparser.y')
-rw-r--r--giscanner/scannerparser.y11
1 files changed, 6 insertions, 5 deletions
diff --git a/giscanner/scannerparser.y b/giscanner/scannerparser.y
index cc495cc3..3457b499 100644
--- a/giscanner/scannerparser.y
+++ b/giscanner/scannerparser.y
@@ -366,15 +366,15 @@ unary_expression
$$ = $2;
break;
case UNARY_MINUS:
- $$ = $2;
+ $$ = gi_source_symbol_copy ($2);
$$->const_int = -$2->const_int;
break;
case UNARY_BITWISE_COMPLEMENT:
- $$ = $2;
+ $$ = gi_source_symbol_copy ($2);
$$->const_int = ~$2->const_int;
break;
case UNARY_LOGICAL_NEGATION:
- $$ = $2;
+ $$ = gi_source_symbol_copy ($2);
$$->const_int = !gi_source_symbol_get_const_boolean ($2);
break;
default:
@@ -818,11 +818,12 @@ type_specifier
struct_or_union_specifier
: struct_or_union identifier_or_typedef_name '{' struct_declaration_list '}'
{
+ GISourceSymbol *sym;
$$ = $1;
$$->name = $2;
$$->child_list = $4;
- GISourceSymbol *sym = gi_source_symbol_new (CSYMBOL_TYPE_INVALID, scanner->current_filename, lineno);
+ sym = gi_source_symbol_new (CSYMBOL_TYPE_INVALID, scanner->current_filename, lineno);
if ($$->type == CTYPE_STRUCT) {
sym->type = CSYMBOL_TYPE_STRUCT;
} else if ($$->type == CTYPE_UNION) {
@@ -1472,9 +1473,9 @@ gi_source_scanner_parse_macros (GISourceScanner *scanner, GList *filenames)
FILE *fmacros =
fdopen (g_file_open_tmp ("gen-introspect-XXXXXX.h", &tmp_name, &error),
"w+");
+ GList *l;
g_unlink (tmp_name);
- GList *l;
for (l = filenames; l != NULL; l = l->next)
{
FILE *f = fopen (l->data, "r");