-
Notifications
You must be signed in to change notification settings - Fork 284
VSD - pointers to heap allocations #6218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
martin-cs
merged 12 commits into
diffblue:develop
from
jezhiggins:vsd-pointers-to-heap-allocations
Jul 27, 2021
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
913f175
Capture heap allocations
jezhiggins 2023081
Allow void* pointers cast to another pointer type
jezhiggins f018cf9
Create heap allocation abstract object on pointer typecast
jezhiggins 791d042
heap object index expression needs to be signed_size_type
jezhiggins ed910a2
Index expression should used signed_size_type rather than size_type
jezhiggins a2e8439
Create symbol name on heap allocation
jezhiggins 4acb533
Move heap object creation off into object factory.
jezhiggins dc7fb2c
Create new symbol for each heap-allocation
jezhiggins 786e2a2
remove redundant apply_comb template
jezhiggins 689df79
Typecasting value-set of pointers needs to propagate down
jezhiggins dfa0154
heap allocation and value-set tests
jezhiggins 1a6a422
vsp = nondet ? malloc(a) : malloc(b) works correctly
jezhiggins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
|
|
||
| int main() | ||
| { | ||
| int *q = malloc(10); | ||
| int *r = malloc(10); | ||
|
|
||
| int *p = r; | ||
| if(nondet()) | ||
| p = q; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| CORE | ||
| main.c | ||
| --variable-sensitivity --vsd-pointers value-set --show | ||
| ^EXIT=0$ | ||
| ^SIGNAL=0$ | ||
| main::1::p \(\) -> value-set-begin: ptr ->\(heap-allocation-0\[0\]\), ptr ->\(heap-allocation-1\[0\]\) :value-set-end | ||
| -- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
|
|
||
| int main() | ||
| { | ||
| int *p = malloc(10); | ||
| if(nondet()) | ||
| ++p; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| CORE | ||
| main.c | ||
| --variable-sensitivity --vsd-pointers value-set --show | ||
| ^EXIT=0$ | ||
| ^SIGNAL=0$ | ||
| main::1::p \(\) -> value-set-begin: ptr ->\(heap-allocation-0\[0\]\), ptr ->\(heap-allocation-0\[1\]\) :value-set-end | ||
| -- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
|
|
||
| int main() | ||
| { | ||
| int *q = malloc(10); | ||
| int r[10]; | ||
|
|
||
| int *p = r; | ||
| if(nondet()) | ||
| p = q; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| CORE | ||
| main.c | ||
| --variable-sensitivity --vsd-pointers value-set --show | ||
| ^EXIT=0$ | ||
| ^SIGNAL=0$ | ||
| main::1::p \(\) -> value-set-begin: ptr ->\(main::1::r\[0\]\), ptr ->\(heap-allocation-0\[0\]\) :value-set-end | ||
| -- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
|
|
||
| int main() | ||
| { | ||
| int *q = malloc(10); | ||
| int r[10]; | ||
|
|
||
| int *p = q; | ||
| if(nondet()) | ||
| p = r; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| CORE | ||
| main.c | ||
| --variable-sensitivity --vsd-pointers value-set --show | ||
| ^EXIT=0$ | ||
| ^SIGNAL=0$ | ||
| main::1::p \(\) -> value-set-begin: ptr ->\(main::1::r\[0\]\), ptr ->\(heap-allocation-0\[0\]\) :value-set-end | ||
| -- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
|
|
||
| int main() | ||
| { | ||
| int *p = malloc(10); | ||
|
|
||
| if(non_det()) | ||
| p = malloc(20); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| CORE | ||
| main.c | ||
| --variable-sensitivity --vsd-pointers value-set --show | ||
| ^EXIT=0$ | ||
| ^SIGNAL=0$ | ||
| main::1::p \(\) -> value-set-begin: ptr ->\(heap-allocation-0\[0\]\), ptr ->\(heap-allocation-1\[0\]\) :value-set-end | ||
| -- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
|
|
||
| int main() | ||
| { | ||
| int *p = nondet() ? malloc(10) : malloc(20); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| CORE | ||
| main.c | ||
| --variable-sensitivity --vsd-pointers value-set --show | ||
| ^EXIT=0$ | ||
| ^SIGNAL=0$ | ||
| main::1::p \(\) -> value-set-begin: ptr ->\(heap-allocation-0\[0\]\), ptr ->\(heap-allocation-1\[0\]\) :value-set-end | ||
| -- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
|
|
||
| int main() | ||
| { | ||
| int *p = malloc(sizeof(int) * 5); | ||
| int *q = malloc(sizeof(int) * 10); | ||
|
|
||
| int *pp = p; | ||
|
|
||
| *p = 10; | ||
| ++p; | ||
| *p = 20; | ||
|
|
||
| q[0] = 100; | ||
| q[99] = 101; | ||
|
|
||
| assert(pp[0] == 10); | ||
| assert(pp[1] == 20); | ||
| assert(q[0] == 100); | ||
| assert(q[99] == 101); | ||
| } |
10 changes: 10 additions & 0 deletions
10
regression/goto-analyzer/heap-allocation-write-2/test-constant-pointers.desc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| CORE | ||
| main.c | ||
| --variable-sensitivity --vsd-pointers constants --vsd-arrays every-element --verify | ||
| ^EXIT=0$ | ||
| ^SIGNAL=0$ | ||
| \[main.assertion.1\] .*p\[.*0\] == 10: SUCCESS | ||
| \[main.assertion.2\] .*p\[.*1\] == 20: SUCCESS | ||
| \[main.assertion.3\] .*q\[.*0\] == 100: SUCCESS | ||
| \[main.assertion.4\] .*q\[.*99\] == 101: SUCCESS | ||
| -- |
10 changes: 10 additions & 0 deletions
10
regression/goto-analyzer/heap-allocation-write-2/test-two-value-pointers.desc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| CORE | ||
| main.c | ||
| --variable-sensitivity --vsd-pointers top-bottom --vsd-arrays every-element --verify | ||
| ^EXIT=0$ | ||
| ^SIGNAL=0$ | ||
| \[main.assertion.1\] .*p\[.*0\] == 10: UNKNOWN | ||
| \[main.assertion.2\] .*p\[.*1\] == 20: UNKNOWN | ||
| \[main.assertion.3\] .*q\[.*0\] == 100: UNKNOWN | ||
| \[main.assertion.4\] .*q\[.*99\] == 101: UNKNOWN | ||
| -- |
10 changes: 10 additions & 0 deletions
10
regression/goto-analyzer/heap-allocation-write-2/test-value-set-pointers.desc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| CORE | ||
| main.c | ||
| --variable-sensitivity --vsd-pointers value-set --vsd-arrays every-element --verify | ||
| ^EXIT=0$ | ||
| ^SIGNAL=0$ | ||
| \[main.assertion.1\] .*p\[.*0\] == 10: SUCCESS | ||
| \[main.assertion.2\] .*p\[.*1\] == 20: SUCCESS | ||
| \[main.assertion.3\] .*q\[.*0\] == 100: SUCCESS | ||
| \[main.assertion.4\] .*q\[.*99\] == 101: SUCCESS | ||
| -- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
|
|
||
| int main() | ||
| { | ||
| int *i_was_malloced = malloc(sizeof(int) * 10); | ||
| int *alias = i_was_malloced; | ||
|
|
||
| *i_was_malloced = 99; | ||
| assert(*alias == 99); | ||
|
|
||
| i_was_malloced[0] = 100; | ||
| assert(*alias == 100); | ||
|
|
||
| *alias += 1; | ||
| assert(i_was_malloced[0] == 101); | ||
|
|
||
| i_was_malloced[1] = 102; | ||
| assert(alias[1] == 102); | ||
| } |
10 changes: 10 additions & 0 deletions
10
regression/goto-analyzer/heap-allocation-write/test-constant-pointers.desc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| CORE | ||
| main.c | ||
| --variable-sensitivity --vsd-pointers constants --vsd-arrays every-element --verify | ||
| ^EXIT=0$ | ||
| ^SIGNAL=0$ | ||
| \[main.assertion.1\] .*alias == 99: SUCCESS | ||
| \[main.assertion.2\] .*alias == 100: SUCCESS | ||
| \[main.assertion.3\] .*i_was_malloced\[.*0\] == 101: SUCCESS | ||
| \[main.assertion.4\] .*alias\[.*1\] == 102: SUCCESS | ||
| -- |
10 changes: 10 additions & 0 deletions
10
regression/goto-analyzer/heap-allocation-write/test-two-value-pointers.desc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| CORE | ||
| main.c | ||
| --variable-sensitivity --vsd-pointers top-bottom --vsd-arrays every-element --verify | ||
| ^EXIT=0$ | ||
| ^SIGNAL=0$ | ||
| \[main.assertion.1\] .*alias == 99: UNKNOWN | ||
| \[main.assertion.2\] .*alias == 100: UNKNOWN | ||
| \[main.assertion.3\] .*i_was_malloced\[.*0\] == 101: UNKNOWN | ||
| \[main.assertion.4\] .*alias\[.*1\] == 102: UNKNOWN | ||
| -- |
10 changes: 10 additions & 0 deletions
10
regression/goto-analyzer/heap-allocation-write/test-value-set-pointers.desc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| CORE | ||
| main.c | ||
| --variable-sensitivity --vsd-pointers value-set --vsd-arrays every-element --verify | ||
| ^EXIT=0$ | ||
| ^SIGNAL=0$ | ||
| \[main.assertion.1\] .*alias == 99: SUCCESS | ||
| \[main.assertion.2\] .*alias == 100: SUCCESS | ||
| \[main.assertion.3\] .*i_was_malloced\[.*0\] == 101: SUCCESS | ||
| \[main.assertion.4\] .*alias\[.*1\] == 102: SUCCESS | ||
| -- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
|
|
||
| int main() | ||
| { | ||
| int *p = malloc(sizeof(int) * 10); | ||
| int *q = malloc(sizeof(int) * 5); | ||
| } |
8 changes: 8 additions & 0 deletions
8
regression/goto-analyzer/heap-allocation/test-constant-pointers.desc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| CORE | ||
| main.c | ||
| --variable-sensitivity --vsd-pointers constants --show | ||
| ^EXIT=0$ | ||
| ^SIGNAL=0$ | ||
| main::1::p \(\) -> ptr ->\(heap-allocation-0\[0\]\) | ||
| main::1::q \(\) -> ptr ->\(heap-allocation-1\[0\]\) | ||
| -- |
8 changes: 8 additions & 0 deletions
8
regression/goto-analyzer/heap-allocation/test-two-value-pointers.desc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| CORE | ||
| main.c | ||
| --variable-sensitivity --vsd-pointers top-bottom --show | ||
| ^EXIT=0$ | ||
| ^SIGNAL=0$ | ||
| main::1::p \(\) -> TOP | ||
| main::1::q \(\) -> TOP | ||
| -- |
8 changes: 8 additions & 0 deletions
8
regression/goto-analyzer/heap-allocation/test-value-set-pointers.desc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| CORE | ||
| main.c | ||
| --variable-sensitivity --vsd-pointers value-set --show | ||
| ^EXIT=0$ | ||
| ^SIGNAL=0$ | ||
| main::1::p \(\) -> value-set-begin: ptr ->\(heap-allocation-0\[0\]\) :value-set-end | ||
| main::1::q \(\) -> value-set-begin: ptr ->\(heap-allocation-1\[0\]\) :value-set-end | ||
| -- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,8 @@ | |
| #include "constant_pointer_abstract_object.h" | ||
|
|
||
| #include <analyses/variable-sensitivity/abstract_environment.h> | ||
| #include <util/arith_tools.h> | ||
| #include <util/c_types.h> | ||
| #include <util/pointer_expr.h> | ||
| #include <util/std_expr.h> | ||
|
|
||
|
|
@@ -33,8 +35,10 @@ constant_pointer_abstract_objectt::constant_pointer_abstract_objectt( | |
| } | ||
|
|
||
| constant_pointer_abstract_objectt::constant_pointer_abstract_objectt( | ||
| const typet &new_type, | ||
| const constant_pointer_abstract_objectt &old) | ||
| : abstract_pointer_objectt(old), value_stack(old.value_stack) | ||
| : abstract_pointer_objectt(new_type, old.is_top(), old.is_bottom()), | ||
| value_stack(old.value_stack) | ||
| { | ||
| } | ||
|
|
||
|
|
@@ -121,6 +125,10 @@ void constant_pointer_abstract_objectt::output( | |
|
|
||
| out << symbol_pointed_to.get_identifier(); | ||
| } | ||
| else if(addressee.id() == ID_dynamic_object) | ||
| { | ||
| out << addressee.get(ID_identifier); | ||
| } | ||
| else if(addressee.id() == ID_index) | ||
| { | ||
| auto const &array_index = to_index_expr(addressee); | ||
|
|
@@ -201,14 +209,41 @@ abstract_object_pointert constant_pointer_abstract_objectt::write_dereference( | |
| abstract_object_pointert modified_value = | ||
| environment.write(pointed_value, new_value, stack, ns, merging_write); | ||
| environment.assign(value, modified_value, ns); | ||
|
|
||
| // but the pointer itself does not change! | ||
| } | ||
| return std::dynamic_pointer_cast<const constant_pointer_abstract_objectt>( | ||
| shared_from_this()); | ||
|
|
||
| return shared_from_this(); | ||
| } | ||
| } | ||
|
|
||
| abstract_object_pointert constant_pointer_abstract_objectt::typecast( | ||
| const typet &new_type, | ||
| const abstract_environmentt &environment, | ||
| const namespacet &ns) const | ||
| { | ||
| INVARIANT(is_void_pointer(type()), "Only allow pointer casting from void*"); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above. |
||
|
|
||
| // Get an expression that we can assign to | ||
| exprt value = to_address_of_expr(value_stack.to_expression()).object(); | ||
| if(value.id() == ID_dynamic_object) | ||
| { | ||
| auto &env = const_cast<abstract_environmentt &>(environment); | ||
|
|
||
| auto heap_array_type = array_typet(new_type.subtype(), nil_exprt()); | ||
| auto array_object = | ||
| environment.abstract_object_factory(heap_array_type, ns, true, false); | ||
| auto heap_symbol = symbol_exprt(value.get(ID_identifier), heap_array_type); | ||
| env.assign(heap_symbol, array_object, ns); | ||
| auto heap_address = address_of_exprt( | ||
| index_exprt(heap_symbol, from_integer(0, signed_size_type()))); | ||
| auto new_pointer = std::make_shared<constant_pointer_abstract_objectt>( | ||
| heap_address, env, ns); | ||
| return new_pointer; | ||
| } | ||
|
|
||
| return std::make_shared<constant_pointer_abstract_objectt>(new_type, *this); | ||
| } | ||
|
|
||
| void constant_pointer_abstract_objectt::get_statistics( | ||
| abstract_object_statisticst &statistics, | ||
| abstract_object_visitedt &visited, | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel kind of conflicted about this. In some ways it should not be an
INVARIANTbecause it can be triggered by a user but also, at the moment we really aren't handling this case. Could we return aTOPpointer of the correct type? Reads from that should giveTOPand writes to it could callhavoc()?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am similarly conflicted. Right now, the call to typecast() is itself guarded so that it will never be called if this invariant will fire
Consequently existing typecasts, of which there are a handful, will evaluate as they do at the moment. I suppose this invariant is more of warning for future care than a guard against wacky corner cases.