mirror of
https://github.com/ringtailsoftware/uvm32.git
synced 2026-06-06 06:53:39 +00:00
Add test for reading slice in extram which is out of bounds
This commit is contained in:
parent
18d787a7b9
commit
b083008d7b
3 changed files with 13 additions and 8 deletions
|
|
@ -49,7 +49,7 @@ void main(void) {
|
|||
p[2] = 'l';
|
||||
p[3] = 'l';
|
||||
p[4] = 'o';
|
||||
printbuf(p, 5); // try to print from extram (unterminated)
|
||||
printbuf(p, 5); // try to print from extram (slice)
|
||||
} break;
|
||||
case TEST10: {
|
||||
uint8_t *p = (uint8_t *)UVM32_EXTRAM_BASE;
|
||||
|
|
@ -69,6 +69,10 @@ void main(void) {
|
|||
// pass a string beyond end of MMIO region
|
||||
println((uint32_t)UVM32_EXTRAM_BASE + 8); // extram has been shrunk, this is now out of bounds, or no terminator found
|
||||
} break;
|
||||
case TEST13: {
|
||||
// pass a slice beyond end of extram
|
||||
printbuf((uint32_t)UVM32_EXTRAM_BASE + 32, 64); // extram has been shrunk, this is now out of bounds,
|
||||
} break;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue