Bugfix: lack of strong type checking when passing arrayref objects to XS caused random lack of infill. Now added strong type checking for all XS entities. Also fixes a potential issue with bridges caused by the same error. #1652

This commit is contained in:
Alessandro Ranellucci
2014-01-12 00:46:23 +01:00
parent 130e8dd8e7
commit a64f7aa8df
8 changed files with 30 additions and 4 deletions

View File

@@ -111,6 +111,8 @@ void
ExPolygon::from_SV_check(SV* expoly_sv)
{
if (sv_isobject(expoly_sv) && (SvTYPE(SvRV(expoly_sv)) == SVt_PVMG)) {
if (!sv_isa(expoly_sv, "Slic3r::ExPolygon") && !sv_isa(expoly_sv, "Slic3r::ExPolygon::Ref"))
CONFESS("Not a valid Slic3r::ExPolygon object");
// a XS ExPolygon was supplied
*this = *(ExPolygon *)SvIV((SV*)SvRV( expoly_sv ));
} else {