Filter: implement dynamic typing for load object
[lttng-ust.git] / liblttng-ust / lttng-filter-specialize.c
index 6de25047787d2b09954d1ce88815f53988463cea..e269db6a32f9775af8b5e70636c3de1feddc56bc 100644 (file)
@@ -422,7 +422,7 @@ static int specialize_load_object(const struct lttng_event_field *field,
                break;
        case atype_dynamic:
                load->object_type = OBJECT_TYPE_DYNAMIC;
-               return -EINVAL;
+               break;
        case atype_struct:
                ERR("Structure type cannot be loaded.");
                return -EINVAL;
@@ -621,6 +621,17 @@ int lttng_filter_specialize_bytecode(struct lttng_event *event,
                        goto end;
 
                case FILTER_OP_RETURN:
+                       if (vstack_ax(stack)->type == REG_S64)
+                               *(filter_opcode_t *) pc = FILTER_OP_RETURN_S64;
+                       ret = 0;
+                       goto end;
+
+               case FILTER_OP_RETURN_S64:
+                       if (vstack_ax(stack)->type != REG_S64) {
+                               ERR("Unexpected register type\n");
+                               ret = -EINVAL;
+                               goto end;
+                       }
                        ret = 0;
                        goto end;
 
This page took 0.023829 seconds and 4 git commands to generate.