Fix compile warning: Potential divide by zero #107254

Open
Iliya Katushenock wants to merge 1 commits from mod_moder/blender:avoid_divide_by_zero into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

This issue appeared 2 years ago, in a commit dba3fb9e09 .
It hasn't been fixed in 2 years and it doesn't seem like it will be fixed?
I tried to figure out the reason, but I couldn't even figure out what the overlay was.
Although, as I see from the code, half of the function is not achievable unless the macro value is changed...

In order not to introduce more macros, i simply added an if that can be defined
at compile time to explicitly change this as not achievable code.

This issue appeared 2 years ago, in a commit https://projects.blender.org/blender/blender/commit/dba3fb9e091acfa7d2144468a220b2b0d577c15d . It hasn't been fixed in 2 years and it doesn't seem like it will be fixed? I tried to figure out the reason, but I couldn't even figure out what the overlay was. Although, as I see from the code, half of the function is not achievable unless the macro value is changed... In order not to introduce more macros, i simply added an if that can be defined at compile time to explicitly change this as not achievable code.
Iliya Katushenock added the
Interest
EEVEE & Viewport
label 2023-04-23 02:09:38 +02:00
Iliya Katushenock added 1 commit 2023-04-23 02:09:48 +02:00
Raul Fernandez Hernandez approved these changes 2024-03-01 04:19:06 +01:00
  • still need to handle the zero case
- [ ] still need to handle the zero case
Author
Member

This code is unreachable, and not sure what result is expected.

This code is unreachable, and not sure what result is expected.
Merge conflict checking is in progress. Try again in few moments.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u avoid_divide_by_zero:mod_moder-avoid_divide_by_zero
git checkout mod_moder-avoid_divide_by_zero
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#107254
No description provided.