Custom Query (146 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (64 - 66 of 146)

Ticket Owner Reporter Resolution Summary
#212 f37yu fixed Revert InferUnion change in new-ast
Description

The partially unresolved inferred parameters are actually useful as suggested by test results. In new-ast an optimization caused this to be no longer possible. The previous change silenced errors in this case and dropped all unresolved inferred parameters, assuming those alternatives are always eliminated. Unfortunately, this does not always happen, so the memory optimization makes resolver incorrect.

Affected code: ResolvExpr::InferMatcher? at SatisfyAssertions?.cpp:226 Expr::InferUnion? at Expr.hpp:68 Old implementation: ResolvExpr::InferMatcher? at ResolveAssertions?.cc:327

#214 m3zulfiq fixed Assertion with sized generic parameter breaks the declaring function's body
Description

A sized generic struct cannot be instantiated in a function with an assertion that takes this struct as a parameter.

forall( otype X )
struct wrapper { X item; };

forall( otype Y 
                #ifndef HIDE_ERROR
                                    | { void unusedHelper( wrapper(Y) ); }
                #endif
      )
void f() {
    wrapper(Y) myvar;
}

Actual (plain): GCC error: '_sizeof_S7wrapper_Y1Y_' undeclared Actual (-DHIDE_ERROR), Expected (both): Compiler success

Desired for the following case in the memory allocator. Here, the affected function is balloc, whose assertion for $balloc_internal takes a parameter of type SS_fill(T). In the affected function's body, the object declaration where the failure happens is the (SS_fill(T)){...} argument initializer.

forall( dtype T | sized(T) ) {
	union  U_fill 	{ char c; T * a; T t; };
	struct SS_fill 	{ char tag; U_fill(T) fill; };
}

static inline forall( dtype T | sized(T) ) {
	T * $balloc_internal( void * Resize, void * Realloc, size_t Align, size_t Dim, SS_fill(T) Fill) {
		return (T*)0p;
	} // $balloc_internal

	forall( ttype TT | { T * $balloc_internal( void *, void *, size_t, size_t, SS_fill(T), TT ); } ) {
	    T * balloc( TT all ) {
	        return $balloc_internal( (void*)0p, (void*)0p, 16, 1, (SS_fill(T)){'0', (U_fill(T)){'0'}}, all);
	    } // balloc
	} // distribution TT
} // distribution T

int main() {
	int * abc = balloc();
	free(abc);
	return 0;
}

Actual: GCC error: '_sizeof_S7SS_fill_Y1T_' undeclared Expected: Compiler success

This revision shows the assertion is at fault (but it does not provide a workaround). The assumption of a TT-fitting $balloc_internal is changed from an assertion to a declaration.

forall( dtype T | sized(T) ) {
	union  U_fill 	{ char c; T * a; T t; };
	struct SS_fill 	{ char tag; U_fill(T) fill; };
}

static inline forall( dtype T | sized(T) ) {
	T * $balloc_internal( void * Resize, void * Realloc, size_t Align, size_t Dim, SS_fill(T) Fill) {
		return (T*)0p;
	} // $balloc_internal

	forall( ttype TT ) {
	    T * $balloc_internal( void *, void *, size_t, size_t, SS_fill(T), TT );
	    T * balloc( TT all ) {
	        return $balloc_internal( (void*)0p, (void*)0p, 16, 1, (SS_fill(T)){'0', (U_fill(T)){'0'}}, all);
	    } // balloc
	} // distribution TT
} // distribution T

int main() {
	int * abc = balloc();
	free(abc);
	return 0;
}

Actual and expected: Compiler success, linker failure to find $balloc_internal( ..., TT ).

#217 ajbeach fixed Typedef Attributes Not Expanded In Functions
Description

Currently we remove all attributes from typedef uses when they are put into a function type. There appears to be an explicate filter that removes them in the ReplaceTypedef? pass. However some attributes actually need to be copied over - even if some of them must not which is probably why they were removed in the first place.

A better solution is just to remove the ones that cannot be copied over. The default probably should be to copy them over as that seems like it will be the solution more often and so far extra attributes have raised much more noticeable errors then missing attributes.

So far aligned appears to be the only one that should be removed.

Note: See TracQuery for help on using queries.