Skip to content

Commit

Permalink
Tweak handler declaration.
Browse files Browse the repository at this point in the history
  • Loading branch information
fzi-hielscher committed Feb 14, 2025
1 parent bdca90e commit 31a1eaf
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tools/arcilator/arcilator-runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,24 +66,22 @@ ARC_ENV_DECL_GET_PRINT_STREAM(id) {
// eltBits: Number of bits per element
// oobAddr: Referenced address outside of array bounds
// oobIdx: Out-of-bounds index
// Return value: Pointer to new the result value of the array_get operation
#define ARC_HANDLER_ARRAY_GET_OOB_HANDLER(base, size, eltBits, oobAddr, \
oobIdx) \
const void *_arc_env_array_get_oob_handler( \
// Return value: Pointer to the new result value of the array_get operation
#define ARC_ENV_DECL_ARRAY_GET_OOB_HANDLER(base, size, eltBits, oobAddr, \
oobIdx) \
ARC_EXPORT const void *_arc_env_array_get_oob_handler( \
const void *base, uint64_t size, uint32_t eltBits, const void *oobAddr, \
uint64_t oobIdx)

#ifndef ARC_NO_DEFAULT_ARRAY_GET_OOB_HANDLER
#include <iostream>
extern "C" {
ARC_HANDLER_ARRAY_GET_OOB_HANDLER(base, as, eb, oa, oi) {
ARC_ENV_DECL_ARRAY_GET_OOB_HANDLER(base, as, eb, oa, oi) {
(void)eb;
(void)oa;
std::cerr << "ARCENV-WARNING: Out-of-bounds array access caught: Index = "
<< oi << ", Size = " << as << ", Base = " << base << std::endl;
return base;
}
}
#endif // ARC_NO_DEFAULT_ARRAY_GET_OOB_HANDLER

// ----------------
Expand Down

0 comments on commit 31a1eaf

Please sign in to comment.