stack0a.c
up: index
prev: stack0.c
next: stack1.c
#include <stdio.h>
#include <cheriintrin.h>
#define LEN 0xffffff
int main()
{
char buff[LEN];
if(cheri_offset_get(&buff) != 0)
{
fprintf(stderr,"non-zero offset\n");
return(10);
}
size_t l = cheri_length_get(&buff);
if(l != LEN)
{
fprintf(stderr,"allocation not exact: %zu vs %zu\n",
l, (size_t)LEN
);
} else
fprintf(stderr,"allocation was exact\n");
}
Experimental data (what does this mean?)
gcc-morello-O0
gcc-morello-O3
clang-morello-O0-bounds-conservative
clang-morello-O3-bounds-conservative
clang-morello-O0-bounds-references-only
clang-morello-O0-bounds-subobject-safe
clang-morello-O3-bounds-subobject-safe
clang-morello-O0-bounds-aggressive
clang-morello-O0-bounds-very-aggressive
clang-morello-O0-bounds-everywhere-unsafe
clang-riscv-O0-bounds-conservative
clang-riscv-O3-bounds-conservative
clang-riscv-O0-bounds-references-only
clang-riscv-O0-bounds-subobject-safe
clang-riscv-O3-bounds-subobject-safe
clang-riscv-O0-bounds-aggressive
clang-riscv-O0-bounds-very-aggressive
clang-riscv-O0-bounds-everywhere-unsafe
cerberus-cheri
cerberus-cheri-no-pnvi
cerberus-cheri-revocation
cerberus-cheri-revocation-no-pnvi
cerberus-cheri-cornucopia
cerberus-cheri-cornucopia-no-pnvi allocation not exact: 16777216 vs 16777215