#include <stdlib.h>
#include <stdio.h>


typedef struct list {
    int val;
    struct list *next;
} list_t;

// void mutate_list(list_t n){
//     list_t *next = n.next;
//     next->val = 42;
// }

int main(){
    list_t first;
    list_t second;

    first.next = &second;
    first.val = 1;
    second.next = NULL;
    second.val = 2;

    // When passing a struct to an unknown function, reachable memory should be invalidated
    mutate_list(first);
    assert(second.val == 2); //UNKNOWN!

    // Passing a pointer to the struct here.
    mutate_list2(&first);
    assert(second.val == 2); //UNKNOWN!
}

Add test where memory is not invalidated correctly.
Add test where memory is not invalidated correctly.
