Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Conversation

@mgreter
Copy link
Contributor

@mgreter mgreter commented Dec 8, 2014

This is in reference to #689

I'm not 100% sure if this really is the right way to "solve" this issue, but it should at least improve the situation slightly. Compiler will now issue a warning if someone tries to return the same value in custom functions ... if warnings are enabled. Any opinions on this? I'm just not sure what the best way is to tell implementors where a copy is needed and where it is not!?

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.15%) when pulling dfb717b on mgreter:fix/const_sass_values into ba767dc on sass:master.

@mgreter mgreter changed the title Make Sass_Values const if possible in API function calls Make Sass_Values const in API function calls Dec 8, 2014
@xzyfer xzyfer modified the milestone: 3.0.3 Dec 9, 2014
@mgreter mgreter self-assigned this Dec 9, 2014
@drewwells
Copy link
Contributor

Hmm, I'm still getting pointer being freed was not allocated when returning the variable passed to me. cgo may not be warning on this constraint.

@mgreter
Copy link
Contributor Author

mgreter commented Dec 11, 2014

As I said, you need to make a copy via sass_clone_value in this case. The compiler will issue a warning if you told it to do so. But it will still let you do insane things.

This should help to avoid issues like sass#689
Compiler should emit a warning in that case
@mgreter mgreter force-pushed the fix/const_sass_values branch from dfb717b to 6274460 Compare December 15, 2014 00:49
@mgreter
Copy link
Contributor Author

mgreter commented Dec 15, 2014

If no one has any more objections I'm going to merge this soon!

mgreter added a commit that referenced this pull request Dec 16, 2014
Make Sass_Values const in API function calls
@mgreter mgreter merged commit 7aaa45a into sass:master Dec 16, 2014
@mgreter mgreter deleted the fix/const_sass_values branch December 16, 2014 20:48
@xzyfer xzyfer modified the milestones: 3.0.3, 3.1 Dec 22, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants