Пример #1
0
/**
package server

This package is registered when Lily is run by Apache through mod_lily. This
package provides Lily with information inside of Apache (such as POST), as well
as functions for sending data through the Apache server.
*/
lily_value *bind_tainted_of(lily_value *input)
{
    lily_instance_val *iv = lily_new_instance_val();
    iv->values = lily_malloc(1 * sizeof(lily_value *));
    iv->instance_id = SYM_CLASS_TAINTED;
    iv->values[0] = input;
    lily_value *result = lily_new_empty_value();
    lily_move_instance_f(MOVE_DEREF_NO_GC, result, iv);
    return result;
}
Пример #2
0
lily_tie *make_variant_default(lily_symtab *symtab,
        lily_variant_class *variant)
{
    /* This makes it easier to destroy, but makes no other difference. */
    lily_type *enum_type = variant->parent->self_type;

    lily_instance_val *iv = lily_new_instance_val();
    iv->instance_id = variant->parent->id;
    iv->variant_id = variant->variant_id;
    iv->num_values = 0;

    lily_tie *ret = make_new_literal_of_type(symtab, enum_type);
    ret->value.instance = iv;
    ret->move_flags = VAL_IS_ENUM;

    return ret;
}
Пример #3
0
lily_tie *make_variant_default(lily_symtab *symtab,
        lily_variant_class *variant)
{
    /* This makes it easier to destroy, but makes no other difference. */
    lily_type *enum_self_type = variant->parent->all_subtypes;

    lily_instance_val *iv = lily_new_instance_val();
    iv->instance_id = variant->parent->id;
    iv->variant_id = variant->variant_id;
    iv->num_values = 0;

    lily_tie *ret = make_new_literal_of_type(symtab, enum_self_type);
    ret->value.instance = iv;
    ret->move_flags = VAL_IS_ENUM;
    /* This variant may not be interesting, but it could be swapped out with a
       variant that is tagged. As a precaution, put it down as retain. */
    if (variant->parent->generic_count != 0)
        ret->move_flags |= VAL_IS_GC_SPECULATIVE;

    return ret;
}