Skip to content

Commit 897bf93

Browse files
Fix: size of script parameter is 0
1 parent ceb8d7b commit 897bf93

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/semantic/dec.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ static void alloc_value_index_struct( struct value_index_alloc*,
252252
struct multi_value*, struct structure* );
253253
static void test_script_number( struct semantic* semantic,
254254
struct script* script );
255+
static void test_script_param_list( struct semantic* semantic,
256+
struct script* script );
255257
static void test_script_body( struct semantic* semantic,
256258
struct script* script );
257259
static void init_builtin_script_aliases( struct semantic* semantic,
@@ -2269,6 +2271,7 @@ void s_test_script( struct semantic* semantic, struct script* script ) {
22692271
if ( script->number ) {
22702272
test_script_number( semantic, script );
22712273
}
2274+
test_script_param_list( semantic, script );
22722275
test_script_body( semantic, script );
22732276
}
22742277

@@ -2328,6 +2331,16 @@ void test_script_number( struct semantic* semantic, struct script* script ) {
23282331
}
23292332
}
23302333

2334+
void test_script_param_list( struct semantic* semantic,
2335+
struct script* script ) {
2336+
struct param* param = script->params;
2337+
while ( param ) {
2338+
calc_param_size( param );
2339+
param->object.resolved = true;
2340+
param = param->next;
2341+
}
2342+
}
2343+
23312344
void test_script_body( struct semantic* semantic, struct script* script ) {
23322345
s_add_scope( semantic, true );
23332346
struct builtin_script_aliases aliases;
@@ -2337,7 +2350,6 @@ void test_script_body( struct semantic* semantic, struct script* script ) {
23372350
if ( param->name ) {
23382351
s_bind_local_name( semantic, param->name, &param->object, true );
23392352
}
2340-
param->object.resolved = true;
23412353
param = param->next;
23422354
}
23432355
struct func_test test;

0 commit comments

Comments
 (0)