| 249 | } |
| 250 | |
| 251 | void CodeCache::patchImport(ImportId id, void* hook_func) { |
| 252 | if (!_imports_patchable && !makeImportsPatchable()) { |
| 253 | return; |
| 254 | } |
| 255 | |
| 256 | for (int ty = 0; ty < NUM_IMPORT_TYPES; ty++) { |
| 257 | void** entry = _imports[id][ty]; |
| 258 | if (entry != NULL) { |
| 259 | *entry = hook_func; |
| 260 | } |
| 261 | } |
| 262 | } |
| 263 | |
| 264 | bool CodeCache::makeImportsPatchable() { |
| 265 | void** min_import = (void**)-1; |
no outgoing calls
no test coverage detected