From 1068e211727a1adc9c4ae881e665058e9b7ce86a Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 29 Jan 2019 13:58:08 +0100 Subject: pkg/compiler: don't warn about the same len twice Also add tests for warnings while we are here. --- pkg/compiler/testdata/warnings.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 pkg/compiler/testdata/warnings.txt (limited to 'pkg/compiler/testdata') diff --git a/pkg/compiler/testdata/warnings.txt b/pkg/compiler/testdata/warnings.txt new file mode 100644 index 000000000..c85fa686d --- /dev/null +++ b/pkg/compiler/testdata/warnings.txt @@ -0,0 +1,21 @@ +# Copyright 2019 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +foo$suspicious_len(a len[b], b ptr[in, array[string]]) ### len target b refer to an array with variable-size elements (do you mean bytesize?) +foo$suspicious_len2(a ptr[in, suspicious_len_struct], b ptr[in, suspicious_len_struct]) +foo$suspicious_len3(a ptr[in, suspicious_len_template[string]], b ptr[in, suspicious_len_template[stringnoz]]) + +suspicious_len_struct { + a len[b, int32] ### len target b refer to an array with variable-size elements (do you mean bytesize?) + b ptr[in, array[string]] +} + +type suspicious_len_template[T] { + a len[b, int32] ### len target b refer to an array with variable-size elements (do you mean bytesize?) + b ptr[in, array[T]] +} + +bar() ### unsupported syscall: bar due to missing const SYS_bar +bar$1() +foo(a const[NO_SUCH_CONST], b r0) ### unsupported syscall: foo due to missing const NO_SUCH_CONST +resource r0[int32]: NO_EITHER ### unsupported resource: r0 due to missing const NO_EITHER -- cgit mrf-deployment