Commit ad359cc6 authored by Laszlo Domoszlai's avatar Laszlo Domoszlai
Browse files

+ remove TRUE,FALSE (we do not need it soon)

+ small fixes
parent 7e6dc3ba
......@@ -106,14 +106,6 @@ void init_desc() {
// Avoid to be overwritten by updateF
__STACK_PLACEHOLDER__ = alloc_prim("PLACEHOLDER", 0);
__STACK_PLACEHOLDER__->base.thunk_size = 0;
__FALSE__ = (Thunk*) alloc_code(sizeof(Thunk));
__FALSE__->desc = (Desc*) __BOOL_SHARED__;
__FALSE__->_bool = false;
__TRUE__ = (Thunk*) alloc_code(sizeof(Thunk));
__TRUE__->desc = (Desc*) __BOOL_SHARED__;
__TRUE__->_bool = true;
}
struct FunEntry* __INT__;
......@@ -131,5 +123,3 @@ struct FunEntry* __ARRAY__;
struct FunEntry* __FORWARD_PTR__;
struct FunEntry* __STACK_PLACEHOLDER__;
struct Thunk* __FALSE__;
struct Thunk* __TRUE__;
......@@ -80,7 +80,4 @@ extern struct FunEntry* __ARRAY__;
extern struct FunEntry* __FORWARD_PTR__;
extern struct FunEntry* __STACK_PLACEHOLDER__;
extern struct Thunk* __FALSE__;
extern struct Thunk* __TRUE__;
#endif // __DESC_H
\ No newline at end of file
......@@ -12,7 +12,7 @@
int readI(Thunk* thunk) {
assert(thunk != NULL);
if (thunk->desc != (Desc*) __INT__ || thunk->desc != (Desc*) __INT_SHARED__) {
if (thunk->desc != (Desc*) __INT__ && thunk->desc != (Desc*) __INT_SHARED__) {
printf("readI: not an integer: ");
printDesc(thunk->desc);
exit(-1);
......@@ -24,7 +24,7 @@ int readI(Thunk* thunk) {
int readB(Thunk* thunk) {
assert(thunk != NULL);
if (thunk->desc != (Desc*) __BOOL__ || thunk->desc != (Desc*) __BOOL_SHARED__) {
if (thunk->desc != (Desc*) __BOOL__ && thunk->desc != (Desc*) __BOOL_SHARED__) {
printf("readB: not a boolean: ");
printDesc(thunk->desc);
exit(-1);
......@@ -44,10 +44,7 @@ struct Thunk* updateI(Thunk* target, int i) {
}
struct Thunk* updateB(Thunk* target, int b) {
if (target == NULL)
{
return b ? __TRUE__ : __FALSE__;
}
if (target == NULL) target = (Thunk*) alloc_heap(sizeof (Thunk));
// always can be overwritten with boxed integer
target->desc = (Desc*) __BOOL__;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment