| 31 | map_t vector_map; |
| 32 | |
| 33 | bool handle_runtime_violation(violation_context& context) |
| 34 | { |
| 35 | const map_t::iterator itr = vector_map.find(static_cast<void*>(context.base_ptr)); |
| 36 | std::string vector_name = (itr != vector_map.end()) ? |
| 37 | itr->second : "Unknown" ; |
| 38 | |
| 39 | printf("Runtime vector access violation\n" |
| 40 | "Vector: %s base: %p end: %p access: %p typesize: %d\n", |
| 41 | vector_name.c_str(), |
| 42 | context.base_ptr , |
| 43 | context.end_ptr , |
| 44 | context.access_ptr , |
| 45 | static_cast<unsigned int>(context.type_size)); |
| 46 | |
| 47 | throw std::runtime_error |
| 48 | ("Runtime vector access violation. Vector: " + vector_name); |
| 49 | |
| 50 | return false; |
| 51 | } |
| 52 | }; |
| 53 | |
| 54 | template <typename T> |
nothing calls this directly
no outgoing calls
no test coverage detected