From 7cc51c9ca35f08b311d71c9dae1a7b3f28ebe71e Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sat, 14 Mar 2020 12:27:23 +0900 Subject: [PATCH] [qfcc] Save block expression creator's address I've already found the bug that necessitated it (and the creator was innocent), but it will help later. --- tools/qfcc/include/expr.h | 1 + tools/qfcc/source/expr.c | 1 + 2 files changed, 2 insertions(+) diff --git a/tools/qfcc/include/expr.h b/tools/qfcc/include/expr.h index b25481a8f..0efc998ba 100644 --- a/tools/qfcc/include/expr.h +++ b/tools/qfcc/include/expr.h @@ -104,6 +104,7 @@ typedef struct { struct expr_s **tail; ///< last expression in the block, for appending struct expr_s *result; ///< the result of this block if non-void int is_call; ///< this block exprssion forms a function call + void *return_addr;///< who allocated this } ex_block_t; typedef struct { diff --git a/tools/qfcc/source/expr.c b/tools/qfcc/source/expr.c index 85c07511b..734886f9a 100644 --- a/tools/qfcc/source/expr.c +++ b/tools/qfcc/source/expr.c @@ -561,6 +561,7 @@ new_block_expr (void) b->type = ex_block; b->e.block.head = 0; b->e.block.tail = &b->e.block.head; + b->e.block.return_addr = __builtin_return_address (0); return b; }