27 lines
903 B
Diff
27 lines
903 B
Diff
From 061612666eaa831feed897f52125f7c7812a51d0 Mon Sep 17 00:00:00 2001
|
|
From: Jakub Wilk <jwilk@jwilk.net>
|
|
Date: Sun, 16 Jul 2017 20:25:04 +0200
|
|
Subject: [PATCH 02/12] Remove const qualifier from parent_scope
|
|
|
|
If parent_scope is declared as const, the compiler may emit code that
|
|
assumes the value doesn't change, i.e. dereferencing the null pointer.
|
|
---
|
|
src/output.c | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git src/output.c src/output.c
|
|
index b825ca2..ed2e48e 100644
|
|
--- src/output.c
|
|
+++ src/output.c
|
|
@@ -288,7 +288,7 @@ void output_open_scope(const char *scope_name, output_scope_type_e scope_type) {
|
|
scope->depth = scope_depth + 1;
|
|
|
|
if (scope_depth > 0) {
|
|
- output_scope_t * const parent_scope = NULL;
|
|
+ output_scope_t * parent_scope = NULL;
|
|
STACK_PEEK(g_scope_stack, (void *)&parent_scope);
|
|
scope->parent_type = parent_scope->type;
|
|
}
|
|
--
|
|
2.26.2.672.g232c24e857
|
|
|