Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let make_constant_value r c t =
- let v = (match classify ctx t, c with
- | _, None -> HVNone
- | (KInt | KFloat | KUInt | KBool) as kind, Some c ->
- (match c with
- | TInt i -> if kind = KUInt then HVUInt i else HVInt i
- | TFloat s -> HVFloat (float_of_string s)
- | TBool b -> HVBool b
- | TNull -> error ("In Flash9, null can't be used as basic type " ^ s_type (print_context()) t) p
- | _ -> assert false)
- | KType(HMPath([],"String")), (Some (TString s)) -> HVString s
- | _, Some TNull -> HVNone
- | k, Some c ->
- (*write ctx (HReg r.rid); *)
- (*write ctx HNull; *)
- (*let j = jump ctx J3Neq in *)
- (*gen_constant ctx c t p; *)
- (*coerce ctx k; *)
- (*write ctx (HSetReg r.rid); *)
- (*j(); *)
- HVNone
- ) in
- match !dparams with
- | None -> if c <> None then dparams := Some [v]
- | Some l -> dparams := Some (v :: l)
- in
Advertisement
Add Comment
Please, Sign In to add comment