From dc3961cfdc636ed6526a452051d41e1a12bfa386 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 29 Jan 2015 23:49:27 -0500 Subject: [PATCH] cmd/5l, cmd/8g: fix build failures REG_R0 etc are defined in on ARM systems. Possible use of uninitialized n in 8g/reg.c. Change-Id: I6e8ce83a6515ca2b779ed8a344a25432db629cc2 Reviewed-on: https://go-review.googlesource.com/3578 Reviewed-by: Russ Cox --- src/cmd/5l/5.out.h | 18 ++++++++++++++++++ src/cmd/8g/reg.c | 2 ++ 2 files changed, 20 insertions(+) diff --git a/src/cmd/5l/5.out.h b/src/cmd/5l/5.out.h index ba738eeb639..aba51c373b3 100644 --- a/src/cmd/5l/5.out.h +++ b/src/cmd/5l/5.out.h @@ -40,6 +40,24 @@ enum #define REGARG -1 /*c2go enum { REGARG = -1 }; */ +// avoid conflict with ucontext.h. sigh. +#define REG_R0 GO_REG_R0 +#define REG_R1 GO_REG_R1 +#define REG_R2 GO_REG_R2 +#define REG_R3 GO_REG_R3 +#define REG_R4 GO_REG_R4 +#define REG_R5 GO_REG_R5 +#define REG_R6 GO_REG_R6 +#define REG_R7 GO_REG_R7 +#define REG_R8 GO_REG_R8 +#define REG_R9 GO_REG_R9 +#define REG_R10 GO_REG_R10 +#define REG_R11 GO_REG_R11 +#define REG_R12 GO_REG_R12 +#define REG_R13 GO_REG_R13 +#define REG_R14 GO_REG_R14 +#define REG_R15 GO_REG_R15 + enum { REG_R0 = 32, // must be 16-aligned diff --git a/src/cmd/8g/reg.c b/src/cmd/8g/reg.c index fe039073a49..7d2de535493 100644 --- a/src/cmd/8g/reg.c +++ b/src/cmd/8g/reg.c @@ -615,6 +615,8 @@ mkvar(Reg *r, Adr *a) case TYPE_MEM: switch(a->name) { + default: + goto none; case NAME_EXTERN: case NAME_STATIC: case NAME_PARAM: