aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
-rw-r--r--evaluate.c2
-rw-r--r--linearize.h4
-rw-r--r--pre-process.c6
-rw-r--r--validation/eval/assign-restricted-ok.c22
-rw-r--r--validation/linear/asm-out0.c2
5 files changed, 32 insertions, 4 deletions
diff --git a/evaluate.c b/evaluate.c
index e13edf54..eea6b7ad 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -1442,7 +1442,7 @@ static int check_assignment_types(struct symbol *target, struct expression **rp,
if (sclass & TYPE_FOULED && unfoul(s) == t)
goto Cast;
if (!restricted_value(*rp, target))
- return 1;
+ goto Cast;
if (s == t)
return 1;
} else if (!(sclass & TYPE_RESTRICT))
diff --git a/linearize.h b/linearize.h
index 429f4797..17e8c38a 100644
--- a/linearize.h
+++ b/linearize.h
@@ -147,8 +147,8 @@ struct instruction {
struct /* asm */ {
const char *string;
struct asm_rules *asm_rules;
- int clobber_memory:1;
- int output_memory:1;
+ unsigned int clobber_memory:1;
+ unsigned int output_memory:1;
};
};
};
diff --git a/pre-process.c b/pre-process.c
index 7a1478f6..3fb25082 100644
--- a/pre-process.c
+++ b/pre-process.c
@@ -884,6 +884,12 @@ static void set_stream_include_path(struct stream *stream)
memcpy(m, stream->name, len);
m[len] = 0;
path = m;
+ /* normalize this path */
+ while (path[0] == '.' && path[1] == '/') {
+ path += 2;
+ while (path[0] == '/')
+ path++;
+ }
}
stream->path = path;
}
diff --git a/validation/eval/assign-restricted-ok.c b/validation/eval/assign-restricted-ok.c
new file mode 100644
index 00000000..df94d8c9
--- /dev/null
+++ b/validation/eval/assign-restricted-ok.c
@@ -0,0 +1,22 @@
+#ifdef __CHECKER__
+#define __bitwise __attribute__((bitwise))
+#else
+#define __bitwise
+#endif
+
+typedef __INT16_TYPE__ __bitwise __be16;
+
+static __be16 foo(void)
+{
+ __be16 val = 0;
+ return val;
+}
+
+/*
+ * check-name: assign-restricted-ok
+ * check-command: test-linearize -fdump-ir $file
+ *
+ * check-output-ignore
+ * check-output-contains: store\\.16
+ * check-output-excludes: store\\.32
+ */
diff --git a/validation/linear/asm-out0.c b/validation/linear/asm-out0.c
index a8e0be69..8b0907b3 100644
--- a/validation/linear/asm-out0.c
+++ b/validation/linear/asm-out0.c
@@ -6,7 +6,7 @@ static void asm_out0(void)
/*
* check-name: asm-out0
- * check-command: test-linearize -fdump-ir $file
+ * check-command: test-linearize -m64 -fdump-ir $file
*
* check-output-start
asm_out0: