Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/net/bpfjit BPF_JMP+BPF_JEQ+BPF_X doesn't compare X wit...
details: https://anonhg.NetBSD.org/src/rev/173ee6ca469a
branches: trunk
changeset: 336156:173ee6ca469a
user: alnsn <alnsn%NetBSD.org@localhost>
date: Sat Feb 14 19:55:05 2015 +0000
description:
BPF_JMP+BPF_JEQ+BPF_X doesn't compare X with k, it compares X with A.
Fix it in the bpfjit_jmp_jeq_x_noinit_ax test.
diffstat:
tests/net/bpfjit/t_bpfjit.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
diffs (56 lines):
diff -r 022bc2f4bc4b -r 173ee6ca469a tests/net/bpfjit/t_bpfjit.c
--- a/tests/net/bpfjit/t_bpfjit.c Sat Feb 14 19:46:55 2015 +0000
+++ b/tests/net/bpfjit/t_bpfjit.c Sat Feb 14 19:55:05 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_bpfjit.c,v 1.8 2015/02/14 17:28:19 alnsn Exp $ */
+/* $NetBSD: t_bpfjit.c,v 1.9 2015/02/14 19:55:05 alnsn Exp $ */
/*-
* Copyright (c) 2011-2012, 2014 Alexander Nasonov.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: t_bpfjit.c,v 1.8 2015/02/14 17:28:19 alnsn Exp $");
+__RCSID("$NetBSD: t_bpfjit.c,v 1.9 2015/02/14 19:55:05 alnsn Exp $");
#include <sys/param.h>
#include <sys/mbuf.h>
@@ -2262,19 +2262,19 @@
rump_unschedule();
}
-ATF_TC(bpfjit_jmp_x_uninitialised);
-ATF_TC_HEAD(bpfjit_jmp_x_uninitialised, tc)
+ATF_TC(bpfjit_jmp_jeq_x_noinit_ax);
+ATF_TC_HEAD(bpfjit_jmp_jeq_x_noinit_ax, tc)
{
atf_tc_set_md_var(tc, "descr", "Test JIT compilation "
- "of BPF_JMP+BPF_EQ+BPF_X with uninitialised X");
-}
-
-ATF_TC_BODY(bpfjit_jmp_x_uninitialised, tc)
+ "of BPF_JMP+BPF_EQ+BPF_X with uninitialised A and X");
+}
+
+ATF_TC_BODY(bpfjit_jmp_jeq_x_noinit_ax, tc)
{
static struct bpf_insn insns[] = {
- BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_X, 1, 0, 1),
- BPF_STMT(BPF_RET+BPF_K, 11),
- BPF_STMT(BPF_RET+BPF_K, 10)
+ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_X, 0, 0, 1),
+ BPF_STMT(BPF_RET+BPF_K, 10),
+ BPF_STMT(BPF_RET+BPF_K, 11)
};
bpfjit_func_t code;
@@ -4567,7 +4567,7 @@
ATF_TP_ADD_TC(tp, bpfjit_jmp_jge_x);
ATF_TP_ADD_TC(tp, bpfjit_jmp_jeq_x);
ATF_TP_ADD_TC(tp, bpfjit_jmp_jset_x);
- ATF_TP_ADD_TC(tp, bpfjit_jmp_x_uninitialised);
+ ATF_TP_ADD_TC(tp, bpfjit_jmp_jeq_x_noinit_ax);
ATF_TP_ADD_TC(tp, bpfjit_jmp_modulo_x);
ATF_TP_ADD_TC(tp, bpfjit_ld_abs);
ATF_TP_ADD_TC(tp, bpfjit_ld_abs_k_overflow);
Home |
Main Index |
Thread Index |
Old Index