summaryrefslogtreecommitdiff
path: root/src/decomp/expr/return.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/decomp/expr/return.c')
-rw-r--r--src/decomp/expr/return.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/decomp/expr/return.c b/src/decomp/expr/return.c
index e29f022..a9c10d9 100644
--- a/src/decomp/expr/return.c
+++ b/src/decomp/expr/return.c
@@ -54,7 +54,7 @@ static void g_return_expression_class_init(GReturnExpressionClass *);
static void g_return_expression_init(GReturnExpression *);
/* Imprime pour l'écran un version humaine d'une expression. */
-static void g_return_expression_print(const GReturnExpression *, GCodeBuffer *, GBufferLine *, GLangOutput *);
+static GBufferLine *g_return_expression_print(const GReturnExpression *, GCodeBuffer *, GBufferLine *, GLangOutput *);
@@ -143,17 +143,22 @@ GDecInstruction *g_return_expression_new(GDecExpression *payload)
* *
******************************************************************************/
-static void g_return_expression_print(const GReturnExpression *expr, GCodeBuffer *buffer, GBufferLine *line, GLangOutput *output)
+static GBufferLine *g_return_expression_print(const GReturnExpression *expr, GCodeBuffer *buffer, GBufferLine *line, GLangOutput *output)
{
+ GBufferLine *result; /* Ligne à retourner */
+
g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, "return", 6, RTT_KEY_WORD);
if (expr->payload != NULL)
{
g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW);
- g_dec_instruction_print(G_DEC_INSTRUCTION(expr->payload),
- buffer, line, output);
+ result = g_dec_instruction_print(G_DEC_INSTRUCTION(expr->payload),
+ buffer, line, output);
}
+ else result = line;
+
+ return result;
}