Changeset aaca19fb68c3cfe89e2acb105d2c3e8f5e028275
- Timestamp:
- 06/20/10 04:51:37 (2 years ago)
- Author:
- redbrain <redbrain@…>
- Parents:
- 20d93fb737c36e2fa36fb1e9ac36734be14a77c6
- Children:
- 15f9f5604c8c79bc8923edc3cbbf26eec93484c9
- git-committer:
- redbrain <redbrain@crules.org> / 2010-06-20T04:51:37Z+0100
- Message:
-
bug fix on many references to single objects in a single context
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r20d93fb
|
raaca19f
|
|
| 134 | 134 | bool (*print_hook)( void * , FILE * , bool ); |
| 135 | 135 | crl_branch_context * context; |
| 136 | | struct crl_number_prot_t * binary_protocol; |
| 137 | | struct crl_builtin_member_def_t * member_fields; |
| 138 | | struct crl_builtin_function_def_t * member_functions; |
| | 136 | const struct crl_number_prot_t * binary_protocol; |
| | 137 | const struct crl_builtin_member_def_t * member_fields; |
| | 138 | const struct crl_builtin_function_def_t * member_functions; |
| 139 | 139 | bool builtin; |
| 140 | 140 | } crl_type_obj_def_t ; |
-
|
r4791bff
|
raaca19f
|
|
| 155 | 155 | }; |
| 156 | 156 | |
| 157 | | struct crl_builtin_function_def_t integer_module_function_table[] = { |
| | 157 | const struct crl_builtin_function_def_t integer_module_function_table[] = { |
| 158 | 158 | { "to_string", 0, &crl_obj_integer_to_string }, |
| 159 | 159 | { NULL, 0, NULL }, |
| 160 | 160 | } ; |
| 161 | 161 | |
| 162 | | struct crl_builtin_member_def_t integer_module_member_table[] = { |
| | 162 | const struct crl_builtin_member_def_t integer_module_member_table[] = { |
| 163 | 163 | { 0, NULL }, |
| 164 | 164 | } ; |
| 165 | 165 | |
| 166 | | struct crl_type_obj_def_t integer_object = { |
| | 166 | const struct crl_type_obj_def_t integer_object = { |
| 167 | 167 | "Int", |
| 168 | 168 | sizeof( crl_type_integer_t ), |
-
|
r20d93fb
|
raaca19f
|
|
| 102 | 102 | } |
| 103 | 103 | } |
| | 104 | |
| | 105 | // def any local symbols pointing to the objects! |
| | 106 | idx = 0; crl_table_entry *c_arr = ctx->symbol_table->array; |
| | 107 | for( ; idx<(ctx->symbol_table->size); ++idx ) |
| | 108 | { |
| | 109 | crl_symbol_obj *o = c_arr[idx].symbol; |
| | 110 | |
| | 111 | if( o ) |
| | 112 | { |
| | 113 | o->n_ref--; |
| | 114 | crl_debug("de-referencing object <%p> to count <%i>!\n", |
| | 115 | (void*)o, o->n_ref ); |
| | 116 | } |
| | 117 | } |
| 104 | 118 | } |
| 105 | 119 | |
-
|
r20d93fb
|
raaca19f
|
|
| 1407 | 1407 | switch( sym->type ) |
| 1408 | 1408 | { |
| 1409 | | /* |
| 1410 | 1409 | case STRUCTURE_CONDIT_CTX: |
| 1411 | 1410 | crl_runtime_conditional_dispatch( sym, context ); |
| … |
… |
|
| 1422 | 1421 | break; |
| 1423 | 1422 | |
| | 1423 | /* |
| 1424 | 1424 | case STRUCTURE_OBJECT_DEF: |
| 1425 | 1425 | if( !(crl_rr_context_push_obj_def( sym, &context )) ) |
-
|
r4791bff
|
raaca19f
|
|
| 52 | 52 | extern bool crl_interactive; |
| 53 | 53 | extern int yylineno; |
| | 54 | |
| | 55 | bool crl_parse_error = false; |
| 54 | 56 | |
| 55 | 57 | // Helps build up symbol tables to have |
| … |
… |
|
| 170 | 172 | { |
| 171 | 173 | crl_runtime_exec_toplevel( $2, crl_runtime_ctx_table ); |
| 172 | | if( (( $2->type != STRUCTURE_FUNCTION_DEF) && |
| 173 | | ($2->type != STRUCTURE_OBJECT_DEF)) ) |
| | 174 | if( !crl_parse_error ) |
| 174 | 175 | { |
| 175 | | crl_garbage_mark_obj( &$2 ); |
| | 176 | if( (( $2->type != STRUCTURE_FUNCTION_DEF) && |
| | 177 | ($2->type != STRUCTURE_OBJECT_DEF)) ) |
| | 178 | { |
| | 179 | crl_garbage_mark_obj( &$2 ); |
| | 180 | } |
| | 181 | } |
| | 182 | else |
| | 183 | { |
| | 184 | if( crl_interactive ) |
| | 185 | { |
| | 186 | crl_parse_error = false; |
| | 187 | crl_garbage_mark_obj( &$2 ); |
| | 188 | } |
| 176 | 189 | } |
| 177 | 190 | } |
| … |
… |
|
| 179 | 192 | { |
| 180 | 193 | crl_error("malformed declaration!\n"); |
| | 194 | crl_parse_error = true; |
| 181 | 195 | } |
| 182 | 196 | ; |