Differences From Artifact [2eef08ac58]:
- File src/amiga-library.m — part of check-in [ad47ca2bf3] at 2020-11-14 12:31:43 on branch amiga-library — Adjust Amiga library to changed function names (user: js, size: 15993) [annotate] [blame] [check-ins using]
To Artifact [e46fd1fbb1]:
- File
src/amiga-library.m
— part of check-in
[82cba67e09]
at
2020-11-14 19:49:04
on branch amiga-library
— Fix theoretically invalid SysBase
This is theoretical, as this is happening in Forbid() and hence nothing
should be able to change it, even after FreeMem(). However, some
debugging tools might break Forbid(), and this commit fixes those. (user: js, size: 16298) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
292 293 294 295 296 297 298 | child->dataSeg += DATA_OFFSET; return &child->library; } static void * | | > > | > > > > > > > | 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 | child->dataSeg += DATA_OFFSET; return &child->library; } static void * expunge(struct ObjFWBase *base, struct ExecBase *sysBase) { #define SysBase sysBase void *segList; if (base->parent != NULL) { base->parent->library.lib_Flags |= LIBF_DELEXP; return 0; } if (base->library.lib_OpenCnt > 0) { base->library.lib_Flags |= LIBF_DELEXP; return 0; } segList = base->segList; Remove(&base->library.lib_Node); FreeMem((char *)base - base->library.lib_NegSize, base->library.lib_NegSize + base->library.lib_PosSize); return segList; #undef SysBase } static void *__saveds lib_expunge(void) { OF_M68K_ARG(struct ObjFWBase *, base, a6) return expunge(base, SysBase); } static void *__saveds lib_close(void) { /* * SysBase becomes invalid during this function, so we store it in * sysBase and add a define to make the inlines use the right one. */ struct ExecBase *sysBase = SysBase; #define SysBase sysBase OF_M68K_ARG(struct ObjFWBase *, base, a6) if (base->parent != NULL) { struct ObjFWBase *parent; #ifdef OF_AMIGAOS_M68K if (base->initialized) |
︙ | ︙ | |||
349 350 351 352 353 354 355 | base->library.lib_NegSize + base->library.lib_PosSize); base = parent; } if (--base->library.lib_OpenCnt == 0 && (base->library.lib_Flags & LIBF_DELEXP)) | | > | 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 | base->library.lib_NegSize + base->library.lib_PosSize); base = parent; } if (--base->library.lib_OpenCnt == 0 && (base->library.lib_Flags & LIBF_DELEXP)) return expunge(base, sysBase); return NULL; #undef SysBase } static void * lib_null(void) { return NULL; } |
︙ | ︙ |