From dee068786b2ef0b0d57fc02ca042e176c74db9b0 Mon Sep 17 00:00:00 2001 From: Alasdair Armstrong Date: Thu, 30 Aug 2018 17:58:33 +0100 Subject: C: Fix a bug where function argument type becomes more specific due to flow typing Added a regression test as c/test/downcast_fn.sail --- lib/sail.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/sail.c') diff --git a/lib/sail.c b/lib/sail.c index 62801cc7..3c0b0dac 100644 --- a/lib/sail.c +++ b/lib/sail.c @@ -172,6 +172,12 @@ void CREATE_OF(sail_int, mach_int)(sail_int *rop, mach_int op) mpz_init_set_si(*rop, op); } +inline +mach_int CREATE_OF(mach_int, sail_int)(const sail_int op) +{ + return mpz_get_ui(op); +} + inline void RECREATE_OF(sail_int, mach_int)(sail_int *rop, mach_int op) { -- cgit v1.2.3