Project

General

Profile

« Previous | Next » 

Revision 81d69074

Added by LĂ©lio Brun 10 months ago

fix bug where singleton tuples were generated

View differences:

src/backends/C/c_backend_spec.ml
98 98

  
99 99
let pp_bool_cast pp fmt x = pp_cast pp_print_string pp fmt ("_Bool", x)
100 100

  
101
let pp_double_cast pp fmt x = pp_cast pp_print_string pp fmt ("double", x)
102

  
101 103
let pp_true_c_bool fmt () = pp_bool_cast pp_print_string fmt "1"
102 104

  
103 105
let pp_false fmt () = pp_print_string fmt "\\false"
......
412 414
  let pp_expr ?(test_output = false) m mem fmt = function
413 415
    | Val v ->
414 416
      let pp = pp_c_val m mem (pp_c_var_read ~test_output m) in
415
      (if not_var v && Types.is_bool_type v.value_type then pp_bool_cast pp else pp) fmt v
417
      (if not_var v
418
       then if Types.is_bool_type v.value_type
419
         then pp_bool_cast pp
420
         else if Types.is_real_type v.value_type
421
         then pp_double_cast pp
422
         else pp
423
       else pp) fmt v
416 424
    | Tag t ->
417 425
      pp_print_string fmt t
418 426
    | Var v ->

Also available in: Unified diff