History

Add new bounds checking functions.

The following functions are now also bounds checked: memcmp, strncpy, strcmp, strncmp, strcat, strchr, strdup. Add statistics code for bounds checking functions. The statistics can be printed by settings environment variable "TCC_BOUNDS_PRINT_STATISTIC". Enabled more tests in test/Makefile.

herman ten brugge committed 6 years ago

Commit 39c0ff31 parent 35512be6 files · +235 −29Browse files

Unified · Split

6 files
  1. lib/Makefile +1 −1
  2. lib/bcheck.c +204 −14
  3. tcc-doc.texi +5 −3
  4. tccgen.c +7 −0
  5. tcctok.h +7 −0
  6. tests/Makefile +11 −11
lib/Makefile+1−1
@@ -42,7 +42,7 @@ ifdef CONFIG_OSX · 41 unmodified lines
4242 XFLAGS += -D_ANSI_SOURCE
4343 endif
4444
45−XFLAGS += -g -Wno-deprecated-declarations
45+XFLAGS += -g
4646
4747 I386_O = libtcc1.o alloca86.o alloca86-bt.o
4848 X86_64_O = libtcc1.o alloca86_64.o alloca86_64-bt.o
lib/bcheck.c+204−14
@@ -35,6 +35,7 @@ · 34 unmodified lines
3535 #endif
3636
3737 #define BOUND_DEBUG
38+#define BOUND_STATISTIC
3839
3940 #ifdef BOUND_DEBUG
4041 #define dprintf(a...) if (print_calls) fprintf(a)
@@ -50,8 +51,7 @@ · 9 unmodified lines
5051 || defined(__DragonFly__) \
5152 || defined(__OpenBSD__) \
5253 || defined(__NetBSD__) \
53− || defined(__dietlibc__) \
54− || defined(_WIN32)
54+ || defined(__dietlibc__)
5555 #undef HAVE_MEMALIGN
5656 #define INIT_SEM()
5757 #define EXIT_SEM()
@@ -59,6 +59,16 @@ · 1 unmodified line
5959 #define POST_SEM()
6060 #define HAS_ENVIRON 0
6161 #define MALLOC_REDIR (0)
62+#elif defined(_WIN32)
63+#include <windows.h>
64+#undef HAVE_MEMALIGN
65+static CRITICAL_SECTION bounds_sem;
66+#define INIT_SEM() InitializeCriticalSection(&bounds_sem)
67+#define EXIT_SEM() DeleteCriticalSection(&bounds_sem)
68+#define WAIT_SEM() EnterCriticalSection(&bounds_sem)
69+#define POST_SEM() LeaveCriticalSection(&bounds_sem)
70+#define HAS_ENVIRON 0
71+#define MALLOC_REDIR (0)
6272 #else
6373 #include <sys/mman.h>
6474 #include <errno.h>
@@ -86,6 +96,7 @@ static unsigned char initial_pool[256]; · 21 unmodified lines
8696 #define TCC_TYPE_CALLOC (2)
8797 #define TCC_TYPE_REALLOC (3)
8898 #define TCC_TYPE_MEMALIGN (4)
99+#define TCC_TYPE_STRDUP (5)
89100
90101 /* this pointer is generated when bound check is incorrect */
91102 #define INVALID_POINTER ((void *)(-2))
@@ -149,9 +160,45 @@ static alloca_list_type *alloca_list = NULL; · 57 unmodified lines
149160 static int inited = 0;
150161 static int print_calls = 0;
151162 static int print_heap = 0;
163+static int print_statistic = 0;
152164 static int never_fatal = 0;
153165 static int no_checking = 0;
154166
167+#ifdef BOUND_STATISTIC
168+static unsigned long bound_ptr_add_count;
169+static unsigned long bound_ptr_indir1_count;
170+static unsigned long bound_ptr_indir2_count;
171+static unsigned long bound_ptr_indir4_count;
172+static unsigned long bound_ptr_indir8_count;
173+static unsigned long bound_ptr_indir12_count;
174+static unsigned long bound_ptr_indir16_count;
175+static unsigned long bound_local_new_count;
176+static unsigned long bound_local_delete_count;
177+static unsigned long bound_malloc_count;
178+static unsigned long bound_calloc_count;
179+static unsigned long bound_realloc_count;
180+static unsigned long bound_free_count;
181+static unsigned long bound_memalign_count;
182+static unsigned long bound_mmap_count;
183+static unsigned long bound_munmap_count;
184+static unsigned long bound_alloca_count;
185+static unsigned long bound_mempcy_count;
186+static unsigned long bound_memcmp_count;
187+static unsigned long bound_memmove_count;
188+static unsigned long bound_memset_count;
189+static unsigned long bound_strlen_count;
190+static unsigned long bound_strcpy_count;
191+static unsigned long bound_strncpy_count;
192+static unsigned long bound_strcmp_count;
193+static unsigned long bound_strncmp_count;
194+static unsigned long bound_strcat_count;
195+static unsigned long bound_strchr_count;
196+static unsigned long bound_strdup_count;
197+#define INCR_COUNT(x) x++
198+#else
199+#define INCR_COUNT(x)
200+#endif
201+
155202 /* enable/disable checking. This can be used for signal handlers. */
156203 void __bound_checking (int no_check)
157204 {
@@ -186,6 +233,7 @@ void * FASTCALL __bound_ptr_add(void *p, size_t offset) · 28 unmodified lines
186233 __FILE__, __FUNCTION__, p, (unsigned)offset);
187234
188235 WAIT_SEM ();
236+ INCR_COUNT(bound_ptr_add_count);
189237 if (tree) {
190238 tree = splay (addr, tree);
191239 addr -= tree->start;
@@ -223,6 +271,7 @@ void * FASTCALL __bound_ptr_indir ## dsize (void *p, size_t offset) \ · 31 unmodified lines
223271 dprintf(stderr, "%s %s: %p 0x%x start\n", \
224272 __FILE__, __FUNCTION__, p, (unsigned)offset); \
225273 WAIT_SEM (); \
274+ INCR_COUNT(bound_ptr_indir ## dsize ## _count); \
226275 if (tree) { \
227276 tree = splay (addr, tree); \
228277 addr -= tree->start; \
@@ -284,6 +333,7 @@ void FASTCALL __bound_local_new(void *p1) · 55 unmodified lines
284333 addr = p[0];
285334 if (addr == 0)
286335 break;
336+ INCR_COUNT(bound_local_new_count);
287337 if (addr == 1) {
288338 dprintf(stderr, "%s, %s() alloca/vla used\n",
289339 __FILE__, __FUNCTION__);
@@ -315,6 +365,7 @@ void FASTCALL __bound_local_delete(void *p1) · 25 unmodified lines
315365 addr = p[0];
316366 if (addr == 0)
317367 break;
368+ INCR_COUNT(bound_local_delete_count);
318369 if (addr == 1) {
319370 while (alloca_list && alloca_list->fp == fp) {
320371 alloca_list_type *next = alloca_list->next;
@@ -350,6 +401,7 @@ void __bound_init(void) · 29 unmodified lines
350401
351402 print_calls = getenv ("TCC_BOUNDS_PRINT_CALLS") != NULL;
352403 print_heap = getenv ("TCC_BOUNDS_PRINT_HEAP") != NULL;
404+ print_statistic = getenv ("TCC_BOUNDS_PRINT_STATISTIC") != NULL;
353405 never_fatal = getenv ("TCC_BOUNDS_NEVER_FATAL") != NULL;
354406
355407 dprintf(stderr, "%s, %s() start\n", __FILE__, __FUNCTION__);
@@ -444,7 +496,7 @@ void __attribute__((destructor)) __bound_exit(void) · 88 unmodified lines
444496 {
445497 int i;
446498 static const char * const alloc_type[] = {
447− "", "malloc", "calloc", "realloc", "memalign"
499+ "", "malloc", "calloc", "realloc", "memalign", "strdup"
448500 };
449501
450502 dprintf(stderr, "%s, %s()\n", __FILE__, __FUNCTION__);
@@ -488,6 +540,39 @@ void __attribute__((destructor)) __bound_exit(void) · 37 unmodified lines
488540 }
489541 EXIT_SEM ();
490542 inited = 0;
543+#ifdef BOUND_STATISTIC
544+ if (print_statistic) {
545+ fprintf (stderr, "bound_ptr_add_count %llu\n", bound_ptr_add_count);
546+ fprintf (stderr, "bound_ptr_indir1_count %llu\n", bound_ptr_indir1_count);
547+ fprintf (stderr, "bound_ptr_indir2_count %llu\n", bound_ptr_indir2_count);
548+ fprintf (stderr, "bound_ptr_indir4_count %llu\n", bound_ptr_indir4_count);
549+ fprintf (stderr, "bound_ptr_indir8_count %llu\n", bound_ptr_indir8_count);
550+ fprintf (stderr, "bound_ptr_indir12_count %llu\n", bound_ptr_indir12_count);
551+ fprintf (stderr, "bound_ptr_indir16_count %llu\n", bound_ptr_indir16_count);
552+ fprintf (stderr, "bound_local_new_count %llu\n", bound_local_new_count);
553+ fprintf (stderr, "bound_local_delete_count %llu\n", bound_local_delete_count);
554+ fprintf (stderr, "bound_malloc_count %llu\n", bound_malloc_count);
555+ fprintf (stderr, "bound_calloc_count %llu\n", bound_calloc_count);
556+ fprintf (stderr, "bound_realloc_count %llu\n", bound_realloc_count);
557+ fprintf (stderr, "bound_free_count %llu\n", bound_free_count);
558+ fprintf (stderr, "bound_memalign_count %llu\n", bound_memalign_count);
559+ fprintf (stderr, "bound_mmap_count %llu\n", bound_mmap_count);
560+ fprintf (stderr, "bound_munmap_count %llu\n", bound_munmap_count);
561+ fprintf (stderr, "bound_alloca_count %llu\n", bound_alloca_count);
562+ fprintf (stderr, "bound_mempcy_count %llu\n", bound_mempcy_count);
563+ fprintf (stderr, "bound_memcmp_count %llu\n", bound_memcmp_count);
564+ fprintf (stderr, "bound_memmove_count %llu\n", bound_memmove_count);
565+ fprintf (stderr, "bound_memset_count %llu\n", bound_memset_count);
566+ fprintf (stderr, "bound_strlen_count %llu\n", bound_strlen_count);
567+ fprintf (stderr, "bound_strcpy_count %llu\n", bound_strcpy_count);
568+ fprintf (stderr, "bound_strncpy_count %llu\n", bound_strncpy_count);
569+ fprintf (stderr, "bound_strcmp_count %llu\n", bound_strcmp_count);
570+ fprintf (stderr, "bound_strncmp_count %llu\n", bound_strncmp_count);
571+ fprintf (stderr, "bound_strcat_count %llu\n", bound_strcat_count);
572+ fprintf (stderr, "bound_strchr_count %llu\n", bound_strchr_count);
573+ fprintf (stderr, "bound_strdup_count %llu\n", bound_strdup_count);
574+ }
575+#endif
491576 }
492577 }
493578
@@ -516,6 +601,7 @@ void *__bound_malloc(size_t size, const void *caller) · 22 unmodified lines
516601 separated by at least one byte. With the glibc malloc, it may
517602 be in fact not necessary */
518603 WAIT_SEM ();
604+ INCR_COUNT(bound_malloc_count);
519605 #if MALLOC_REDIR
520606 ptr = malloc_redir (size);
521607 #else
@@ -544,6 +630,7 @@ void *__bound_memalign(size_t size, size_t align, const void *caller) · 22 unmodified lines
544630 void *ptr;
545631
546632 WAIT_SEM ();
633+ INCR_COUNT(bound_memalign_count);
547634
548635 #ifndef HAVE_MEMALIGN
549636 if (align > 4) {
@@ -599,6 +686,7 @@ void __bound_free(void *ptr, const void *caller) · 49 unmodified lines
599686 dprintf(stderr, "%s, %s (%p)\n", __FILE__, __FUNCTION__, ptr);
600687
601688 WAIT_SEM ();
689+ INCR_COUNT(bound_free_count);
602690 tree = splay (addr, tree);
603691 if (tree->start == addr) {
604692 if (tree->is_invalid) {
@@ -645,6 +733,7 @@ void *__bound_realloc(void *ptr, size_t size, const void *caller) · 40 unmodified lines
645733 ptr = realloc (ptr, size);
646734 #endif
647735 WAIT_SEM ();
736+ INCR_COUNT(bound_realloc_count);
648737 if (ptr) {
649738 tree = splay_insert ((size_t) ptr, size, tree);
650739 if (tree->start == (size_t) ptr) {
@@ -701,6 +790,7 @@ void *__bound_calloc(size_t nmemb, size_t size) · 50 unmodified lines
701790 if (ptr) {
702791 memset (ptr, 0, size);
703792 WAIT_SEM ();
793+ INCR_COUNT(bound_calloc_count);
704794 tree = splay_insert ((size_t) ptr, size, tree);
705795 if (tree->start == (size_t) ptr) {
706796 tree->type = TCC_TYPE_CALLOC;
@@ -721,6 +811,7 @@ void *__bound_mmap (void *start, size_t size, int prot, · 14 unmodified lines
721811 result = mmap (start, size, prot, flags, fd, offset);
722812 if (result) {
723813 WAIT_SEM ();
814+ INCR_COUNT(bound_mmap_count);
724815 tree = splay_insert((size_t)result, size, tree);
725816 POST_SEM ();
726817 }
@@ -734,6 +825,7 @@ int __bound_munmap (void *start, size_t size) · 7 unmodified lines
734825 dprintf(stderr, "%s, %s (%p, 0x%x)\n",
735826 __FILE__, __FUNCTION__, start, (unsigned)size);
736827 WAIT_SEM ();
828+ INCR_COUNT(bound_munmap_count);
737829 tree = splay_delete ((size_t) start, tree);
738830 POST_SEM ();
739831 result = munmap (start, size);
@@ -751,6 +843,7 @@ void __bound_new_region(void *p, size_t size) · 11 unmodified lines
751843 dprintf(stderr, "%s, %s (%p, 0x%x)\n",
752844 __FILE__, __FUNCTION__, p, (unsigned)size);
753845 WAIT_SEM ();
846+ INCR_COUNT(bound_alloca_count);
754847 GET_CALLER_FP (fp);
755848 last = NULL;
756849 cur = alloca_list;
@@ -813,6 +906,7 @@ void *__bound_memcpy(void *dst, const void *src, size_t size) · 56 unmodified lines
813906 {
814907 void* p;
815908
909+ INCR_COUNT(bound_mempcy_count);
816910 __bound_check(dst, size);
817911 __bound_check(src, size);
818912 /* check also region overlap */
@@ -824,8 +918,17 @@ void *__bound_memcpy(void *dst, const void *src, size_t size) · 5 unmodified lines
824918 return p;
825919 }
826920
921+int __bound_memcmp(const void *s1, const void *s2, size_t size)
922+{
923+ INCR_COUNT(bound_memcmp_count);
924+ __bound_check(s1, size);
925+ __bound_check(s2, size);
926+ return memcmp(s1, s2, size);
927+}
928+
827929 void *__bound_memmove(void *dst, const void *src, size_t size)
828930 {
931+ INCR_COUNT(bound_memmove_count);
829932 __bound_check(dst, size);
830933 __bound_check(src, size);
831934 return memmove(dst, src, size);
@@ -833,25 +936,22 @@ void *__bound_memmove(void *dst, const void *src, size_t size) · 1 unmodified line
833936
834937 void *__bound_memset(void *dst, int c, size_t size)
835938 {
939+ INCR_COUNT(bound_memset_count);
836940 __bound_check(dst, size);
837941 return memset(dst, c, size);
838942 }
839943
840−/* XXX: could be optimized */
841944 int __bound_strlen(const char *s)
842945 {
843− const char *p;
946+ const char *p = s;
844947 size_t len;
845948
846− len = 0;
847− for(;;) {
848− p = __bound_ptr_indir1((char *)s, len);
849− if (p == INVALID_POINTER)
850− bound_error("bad pointer in strlen()");
851− if (*p == '\0')
852− break;
853− len++;
854− }
949+ INCR_COUNT(bound_strlen_count);
950+ while (*p++);
951+ len = (p - s) - 1;
952+ p = __bound_ptr_indir1((char *)s, len);
953+ if (p == INVALID_POINTER)
954+ bound_error("bad pointer in strlen()");
855955 return len;
856956 }
857957
@@ -860,11 +960,101 @@ char *__bound_strcpy(char *dst, const char *src) · 2 unmodified lines
860960 size_t len;
861961 void *p;
862962
963+ INCR_COUNT(bound_strcpy_count);
863964 len = __bound_strlen(src);
864965 p = __bound_memcpy(dst, src, len + 1);
865966 return p;
866967 }
867968
969+char *__bound_strncpy(char *dst, const char *src, size_t n)
970+{
971+ size_t len;
972+ void *p;
973+
974+ INCR_COUNT(bound_strncpy_count);
975+ __bound_check(dst, n);
976+ __bound_check(src, n);
977+ return strncpy (dst, src, n);
978+}
979+
980+int __bound_strcmp(const char *s1, const char *s2)
981+{
982+ const unsigned char *u1 = (const unsigned char *) s1;
983+ const unsigned char *u2 = (const unsigned char *) s2;
984+
985+ INCR_COUNT(bound_strcmp_count);
986+ while (*u1 && *u1 == *u2) {
987+ u1++;
988+ u2++;
989+ }
990+ __bound_check(s1, ((const char *)u1 - s1) + 1);
991+ __bound_check(s2, ((const char *)u2 - s2) + 1);
992+ return (*u1 - *u2);
993+}
994+
995+int __bound_strncmp(const char *s1, const char *s2, size_t n)
996+{
997+ INCR_COUNT(bound_strncmp_count);
998+ __bound_check(s1, n);
999+ __bound_check(s2, n);
1000+ return strncmp(s1, s2, n);
1001+}
1002+
1003+char *__bound_strcat(char *dest, const char *src)
1004+{
1005+ char *r = dest;
1006+ const char *s = src;
1007+
1008+ INCR_COUNT(bound_strcat_count);
1009+ while (*dest++);
1010+ dest--;
1011+ while ((*dest++ = *src++) != 0);
1012+ __bound_check(r, dest - r);
1013+ __bound_check(s, src - s);
1014+ return r;
1015+}
1016+
1017+char *__bound_strchr(const char *string, int ch)
1018+{
1019+ const unsigned char *s = (const unsigned char *) string;
1020+ unsigned char c = ch;
1021+
1022+ INCR_COUNT(bound_strchr_count);
1023+ while (*s) {
1024+ if (*s == c) {
1025+ break;
1026+ }
1027+ s++;
1028+ }
1029+ __bound_check(string, ((const char *)s - string) + 1);
1030+ return *s == c ? (char *) s : NULL;
1031+}
1032+
1033+char *__bound_strdup(const char *s)
1034+{
1035+ const char *p = s;
1036+ char *new;
1037+
1038+ INCR_COUNT(bound_strdup_count);
1039+ while (*p++);
1040+ __bound_check(s, p - s);
1041+#if MALLOC_REDIR
1042+ new = malloc_redir (p - s);
1043+#else
1044+ new = malloc (p - s);
1045+#endif
1046+ if (new) {
1047+ WAIT_SEM ();
1048+ tree = splay_insert((size_t)new, p - s, tree);
1049+ if (tree->start == (size_t) new) {
1050+ tree->type = TCC_TYPE_STRDUP;
1051+ }
1052+ memcpy (new, s, p - s);
1053+ POST_SEM ();
1054+ }
1055+ return new;
1056+}
1057+
8681058 /*
8691059 An implementation of top-down splaying with sizes
8701060 D. Sleator <sleator@cs.cmu.edu>, January 1994.
tcc-doc.texi+5−3
@@ -356,12 +356,14 @@ memory allocations and array/pointer bounds. @option{-g} is implied. Note · 355 unmodified lines
356356 that the generated code is slower and bigger in this case.
357357 The bound checking code is not included in shared libaries. The main executable should always be compiled with the @option{-b}.
358358
359−There are three environment variables that can be used:
359+There are four environment variables that can be used:
360360 @table @option
361361 @item TCC_BOUNDS_PRINT_CALLS
362362 Print bound checking calls. Can be used for debugging.
363363 @item TCC_BOUNDS_PRINT_HEAP
364364 Print heap objects that are not freed at exit of program.
365+@item TCC_BOUNDS_PRINT_STATISTIC
366+Print statistic information at exit of program.
365367 @item TCC_BOUNDS_NEVER_FATAL
366368 Try to continue in case of a bound checking error.
367369 @end table
@@ -915,7 +917,7 @@ Here are some examples of caught errors: · 547 unmodified lines
915917 int *tab;
916918 tab = malloc(20 * sizeof(int));
917919 for(i=0;i<21;i++) @{
918− sum += tab4[i];
920+ sum += tab[i];
919921 @}
920922 free(tab);
921923 @}
@@ -928,7 +930,7 @@ Here are some examples of caught errors: · 6 unmodified lines
928930 tab = malloc(20 * sizeof(int));
929931 free(tab);
930932 for(i=0;i<20;i++) @{
931− sum += tab4[i];
933+ sum += tab[i];
932934 @}
933935 @}
934936 @end example
tccgen.c+7−0
@@ -432,8 +432,15 @@ ST_FUNC void put_extern_sym2(Sym *sym, int sh_num, · 431 unmodified lines
432432 case TOK_memcpy:
433433 case TOK_memmove:
434434 case TOK_memset:
435+ case TOK_memcmp:
435436 case TOK_strlen:
436437 case TOK_strcpy:
438+ case TOK_strncpy:
439+ case TOK_strcmp:
440+ case TOK_strncmp:
441+ case TOK_strcat:
442+ case TOK_strchr:
443+ case TOK_strdup:
437444 case TOK_alloca:
438445 case TOK_mmap:
439446 case TOK_munmap:
tcctok.h+7−0
@@ -314,8 +314,15 @@ · 313 unmodified lines
314314 # endif
315315 DEF(TOK_mmap, "mmap")
316316 DEF(TOK_munmap, "munmap")
317+ DEF(TOK_memcmp, "memcmp")
317318 DEF(TOK_strlen, "strlen")
318319 DEF(TOK_strcpy, "strcpy")
320+ DEF(TOK_strncpy, "strncpy")
321+ DEF(TOK_strcmp, "strcmp")
322+ DEF(TOK_strncmp, "strncmp")
323+ DEF(TOK_strcat, "strcat")
324+ DEF(TOK_strchr, "strchr")
325+ DEF(TOK_strdup, "strdup")
319326 #endif
320327
321328 /* Tiny Assembler */
tests/Makefile+11−11
@@ -23,13 +23,12 @@ TESTS = \ · 22 unmodified lines
2323 tests2-dir \
2424 pp-dir
2525
26−BTESTS = test1b test3b btest
26+BTESTS = test1b test3b btest test4
2727
28−# test4 -- problem with -static
28+# test4_static -- Not all relocation types are implemented yet.
2929 # asmtest / asmtest2 -- minor differences with gcc
30−# btest -- works on i386 (including win32)
3130
32−# bounds-checking is supported only on i386
31+# bounds-checking is supported on i386 and x86_64 on linux and windows
3332 ifeq ($(ARCH),i386)
3433 TESTS += $(BTESTS)
3534 endif
@@ -116,7 +115,7 @@ test3 test3b: tcctest.c test.ref · 80 unmodified lines
116115 $(TCC) $(RUN_TCC) $(RUN_TCC) $(RUN_TCC) -run $< > test.out3
117116 @diff -u test.ref test.out3 && echo "Auto Test3 OK"
118117
119−test%b : TCCFLAGS += -b
118+test%b : TCCFLAGS += -b -ba
120119
121120 # binary output test
122121 test4: tcctest.c test.ref
@@ -131,10 +130,12 @@ test4: tcctest.c test.ref · 8 unmodified lines
131130 ./tcctest1 > test1.out
132131 @if diff -u test.ref test1.out ; then echo "Dynamic Auto Test OK"; fi
133132 # dynamic output + bound check
134− $(TCC) -b -o tcctest4 $<
133+ $(TCC) -b -ba -o tcctest4 $<
135134 ./tcctest4 > test4.out
136135 @if diff -u test.ref test4.out ; then echo "BCheck Auto Test OK"; fi
137−# static output
136+
137+test4_static: tcctest.c test.ref
138+# static output.
138139 $(TCC) -static -o tcctest2 $<
139140 ./tcctest2 > test2.out
140141 @if diff -u test.ref test2.out ; then echo "Static Auto Test OK"; fi
@@ -162,8 +163,7 @@ memtest: · 21 unmodified lines
162163
163164
164165 # memory and bound check auto test
165−# 3 is profiling test
166−BOUNDS_OK = 1 4 8 10 14 16
166+BOUNDS_OK = 1 3 4 8 10 14 16
167167 BOUNDS_FAIL= 2 5 6 7 9 11 12 13 15 17
168168
169169 btest: boundtest.c
@@ -171,7 +171,7 @@ btest: boundtest.c · 1 unmodified line
171171 @ulimit -c 0; \
172172 for i in $(BOUNDS_OK); do \
173173 echo ; echo --- boundtest $$i ---; \
174− if $(TCC) -b -run $< $$i ; then \
174+ if $(TCC) -b -ba -run $< $$i ; then \
175175 echo succeeded as expected; \
176176 else\
177177 echo Failed positive test $$i ; exit 1 ; \
@@ -179,7 +179,7 @@ btest: boundtest.c · 1 unmodified line
179179 done ;\
180180 for i in $(BOUNDS_FAIL); do \
181181 echo ; echo --- boundtest $$i ---; \
182− if $(TCC) -b -run $< $$i ; then \
182+ if $(TCC) -b -ba -run $< $$i ; then \
183183 echo Failed negative test $$i ; exit 1 ;\
184184 else\
185185 echo failed as expected; \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t