diff --git a/src/apps/debugger/types/ValueLocation.h b/src/apps/debugger/types/ValueLocation.h
index ede62a8..57c0c0f 100644
a
|
b
|
struct ValuePieceLocation {
|
43 | 43 | { |
44 | 44 | } |
45 | 45 | |
| 46 | ValuePieceLocation(const ValuePieceLocation& other) |
| 47 | { |
| 48 | Copy(other); |
| 49 | } |
| 50 | |
46 | 51 | ~ValuePieceLocation() |
47 | 52 | { |
48 | | if (value != NULL) |
| 53 | if (value != NULL) { |
| 54 | printf("ValueLocation %p freeing value %p\n", this, value); |
49 | 55 | free(value); |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | ValuePieceLocation& operator=(const ValuePieceLocation& other) |
| 60 | { |
| 61 | Copy(other); |
| 62 | return *this; |
| 63 | } |
| 64 | |
| 65 | |
| 66 | bool Copy(const ValuePieceLocation& other) |
| 67 | { |
| 68 | memcpy(this, &other, sizeof(ValuePieceLocation)); |
| 69 | if (type == VALUE_PIECE_LOCATION_IMPLICIT) { |
| 70 | void* tempValue = malloc(size); |
| 71 | if (tempValue == NULL) { |
| 72 | type = VALUE_PIECE_LOCATION_INVALID; |
| 73 | return false; |
| 74 | } |
| 75 | |
| 76 | memcpy(tempValue, value, other.size); |
| 77 | value = tempValue; |
| 78 | } |
| 79 | |
| 80 | return true; |
50 | 81 | } |
51 | 82 | |
52 | 83 | bool IsValid() const |