Cgen: proper assignments from constant variables.

This commit is contained in:
Adrien Guatto 2010-10-02 13:17:12 +02:00
parent 412fd1f81b
commit 0ce7b4efb0

View file

@ -397,6 +397,9 @@ let generate_function_call var_env obj_env outvl objn args =
(** Create the statement dest = c where c = v^n^m... *)
let rec create_affect_const var_env dest c =
match c.se_desc with
| Svar ln ->
let se = Static.simplify QualEnv.empty (find_const ln).c_value in
create_affect_const var_env dest se
| Sarray_power(c, n) ->
let x = gen_symbol () in
[Cfor(x, 0, int_of_static_exp n,