| 431 | // ---- scan pointer (struct pointer) ---- |
| 432 | |
| 433 | bool scanPointer(char * dst, TypeInfo * ti) { |
| 434 | if (isNull()) { |
| 435 | *(char**)dst = nullptr; |
| 436 | return true; |
| 437 | } |
| 438 | if (ti->firstType && ti->firstType->type == Type::tStructure && ti->firstType->structType) { |
| 439 | auto si = ti->firstType->structType; |
| 440 | char * ptr = ctx.allocate(si->size, at); |
| 441 | if (!ptr) return false; |
| 442 | memset(ptr, 0, si->size); |
| 443 | if (!scanStruct(ptr, si)) return false; |
| 444 | *(char**)dst = ptr; |
| 445 | return true; |
| 446 | } |
| 447 | // unsupported pointer type — skip |
| 448 | return skipValue(); |
| 449 | } |
| 450 | |
| 451 | // ---- scan dynamic array ---- |
| 452 | |