diff --git a/filter/decl.m4 b/filter/decl.m4
index a78450a353adc764e32eb4b2f70097b8130a48d0..efecb9a57e6f9e4468c92826a2c98ab785fb70ca 100644
--- a/filter/decl.m4
+++ b/filter/decl.m4
@@ -161,11 +161,16 @@ FID_HIC(,[[
 
 #	Some arguments need to check their type. After that, ARG_ANY is called.
 m4_define(ARG, `ARG_ANY($1) ARG_TYPE($1,$2)')
-m4_define(ARG_TYPE, `
+m4_define(ARG_TYPE, `ARG_TYPE_STATIC($1,$2) ARG_TYPE_DYNAMIC($1,$2)')
+
+m4_define(ARG_TYPE_STATIC, `
 FID_NEW_BODY()m4_dnl
 if (f$1->type && (f$1->type != ($2)) && !f_const_promotion(f$1, ($2)))
   cf_error("Argument $1 of %s must be of type %s, got type %s",
 	   f_instruction_name(what->fi_code), f_type_name($2), f_type_name(f$1->type));
+FID_INTERPRET_BODY()')
+
+m4_define(ARG_TYPE_DYNAMIC, `
 FID_INTERPRET_EXEC()m4_dnl
 if (v$1.type != ($2))
   runtime("Argument $1 of %s must be of type %s, got type %s",
diff --git a/filter/f-inst.c b/filter/f-inst.c
index 51a35350986adaa7e09621b0e0326183f2c54b35..4b3c627b57b802e2e6b8ce4e514530b1b2c2be41 100644
--- a/filter/f-inst.c
+++ b/filter/f-inst.c
@@ -226,7 +226,7 @@
   }
   INST(FI_AND, 1, 1) {
     ARG(1,T_BOOL);
-    ARG_TYPE(2,T_BOOL);
+    ARG_TYPE_STATIC(2,T_BOOL);
     RESULT_TYPE(T_BOOL);
 
     if (v1.val.i)
@@ -236,7 +236,7 @@
   }
   INST(FI_OR, 1, 1) {
     ARG(1,T_BOOL);
-    ARG_TYPE(2,T_BOOL);
+    ARG_TYPE_STATIC(2,T_BOOL);
     RESULT_TYPE(T_BOOL);
 
     if (!v1.val.i)