Unified · Split
| @@ -5601,17 +5601,16 @@ ST_FUNC void unary(void) · 5600 unmodified lines | ||
| 5601 | 5601 | case TOK_builtin_return_address: |
| 5602 | 5602 | { |
| 5603 | 5603 | int tok1 = tok; |
| 5604 | − int level; | |
| 5604 | + int64_t level; | |
| 5605 | 5605 | next(); |
| 5606 | 5606 | skip('('); |
| 5607 | − if (tok != TOK_CINT) { | |
| 5607 | + level = expr_const64(); | |
| 5608 | + if (level < 0) { | |
| 5608 | 5609 | tcc_error("%s only takes positive integers", |
| 5609 | 5610 | tok1 == TOK_builtin_return_address ? |
| 5610 | 5611 | "__builtin_return_address" : |
| 5611 | 5612 | "__builtin_frame_address"); |
| 5612 | 5613 | } |
| 5613 | − level = (uint32_t)tokc.i; | |
| 5614 | − next(); | |
| 5615 | 5614 | skip(')'); |
| 5616 | 5615 | type.t = VT_VOID; |
| 5617 | 5616 | mk_pointer(&type); |
| @@ -25,12 +25,6 @@ int compile_errors(void) · 24 unmodified lines | ||
| 25 | 25 | l1: return 1; |
| 26 | 26 | l2: return 2; |
| 27 | 27 | } |
| 28 | −#endif | |
| 29 | −#if TEST == 4 | |
| 30 | − { | |
| 31 | − /* Only integer allowed */ | |
| 32 | − __builtin_return_address(0 + 1) != NULL; | |
| 33 | − } | |
| 34 | 28 | #endif |
| 35 | 29 | return 0; |
| 36 | 30 | } |