This commit is contained in:
enricoturri1966 2022-02-01 08:08:01 +01:00
commit 1fa20aaaa4
12 changed files with 85 additions and 7 deletions

View file

@ -843,6 +843,15 @@ extern "C" {
}
#endif
#if defined(SLIC3R_UBSAN)
extern "C" {
// Enable printing stacktrace by default. It can be disabled by running PrusaSlicer with "UBSAN_OPTIONS=print_stacktrace=0".
const char *__ubsan_default_options() {
return "print_stacktrace=1";
}
}
#endif
#if defined(_MSC_VER) || defined(__MINGW32__)
extern "C" {
__declspec(dllexport) int __stdcall slic3r_main(int argc, wchar_t **argv)

View file

@ -2391,7 +2391,7 @@ static std::vector<MonotonicRegionLink> chain_monotonic_regions(
// Probability (unnormalized) of traversing a link between two monotonic regions.
auto path_probability = [
#ifndef __APPLE__
#if !defined(__APPLE__) && !defined(__clang__)
// clang complains when capturing constexpr constants.
pheromone_alpha, pheromone_beta
#endif // __APPLE__

View file

@ -105,6 +105,11 @@ public:
static inline Int128 multiply(int64_t lhs, int64_t rhs) { return Int128(__int128(lhs) * __int128(rhs)); }
#if defined(__clang__)
// When Clang is used with enabled UndefinedBehaviorSanitizer, it produces "undefined reference to '__muloti4'" when __int128 is used.
// Because of that, UndefinedBehaviorSanitizer is disabled for this function.
__attribute__((no_sanitize("undefined")))
#endif
// Evaluate signum of a 2x2 determinant.
static int sign_determinant_2x2(int64_t a11, int64_t a12, int64_t a21, int64_t a22)
{

View file

@ -2264,7 +2264,7 @@ void check_model_ids_validity(const Model &model)
for (const ModelInstance *model_instance : model_object->instances)
check(model_instance->id());
}
for (const auto mm : model.materials) {
for (const auto &mm : model.materials) {
check(mm.second->id());
check(mm.second->config.id());
}

View file

@ -17,7 +17,8 @@ class MultiPoint
public:
Points points;
MultiPoint() {}
MultiPoint() = default;
virtual ~MultiPoint() = default;
MultiPoint(const MultiPoint &other) : points(other.points) {}
MultiPoint(MultiPoint &&other) : points(std::move(other.points)) {}
MultiPoint(std::initializer_list<Point> list) : points(list) {}

View file

@ -19,7 +19,7 @@ class Polygon : public MultiPoint
{
public:
Polygon() = default;
virtual ~Polygon() = default;
~Polygon() override = default;
explicit Polygon(const Points &points) : MultiPoint(points) {}
Polygon(std::initializer_list<Point> points) : MultiPoint(points) {}
Polygon(const Polygon &other) : MultiPoint(other.points) {}

View file

@ -16,7 +16,8 @@ typedef std::vector<ThickPolyline> ThickPolylines;
class Polyline : public MultiPoint {
public:
Polyline() {};
Polyline() = default;
~Polyline() override = default;
Polyline(const Polyline &other) : MultiPoint(other.points) {}
Polyline(Polyline &&other) : MultiPoint(std::move(other.points)) {}
Polyline(std::initializer_list<Point> list) : MultiPoint(list) {}

View file

@ -654,7 +654,7 @@ void FirmwareDialog::priv::perform_upload()
}
})
.on_message([
#ifndef __APPLE__
#if !defined(__APPLE__) && !defined(__clang__)
// clang complains when capturing constants.
extra_verbose,
#endif // __APPLE__

View file

@ -185,7 +185,7 @@ public:
OptionsGroup( wxWindow* _parent, const wxString& title, bool is_tab_opt = false,
column_t extra_clmn = nullptr);
~OptionsGroup() { clear(true); }
virtual ~OptionsGroup() { clear(true); }
wxGridSizer* get_grid_sizer() { return m_grid_sizer; }
const std::vector<Line>& get_lines() { return m_lines; }
@ -253,6 +253,7 @@ public:
OptionsGroup(parent, title, is_tab_opt, extra_clmn), m_config(&config->get()), m_modelconfig(config) {}
ConfigOptionsGroup( wxWindow* parent) :
OptionsGroup(parent, wxEmptyString, true, nullptr) {}
~ConfigOptionsGroup() override = default;
const wxString& config_category() const throw() { return m_config_category; }
int config_type() const throw() { return m_config_type; }