Skip to content

Class with type_conversion from int and "==" operator causes switch s… #422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

dinghram
Copy link
Contributor

@dinghram dinghram commented Mar 5, 2018

…tatement to compare destroyed objects

I added a Function_Push_Pop to save the match_value and the value from evaluating the case statement. This makes the code look like Fold_Right_Binary_Operator_AST_Node::do_oper, which does not have the same defect behavior.

Issue this pull request references: #421

Changes proposed in this pull request

  • chaiscript_eval.hpp: Switch_AST_Node::eval_internal

…tatement to compare destroyed objects

I added a Function_Push_Pop to save the match_value and the value from evaluating the case statement. This makes the code look like Fold_Right_Binary_Operator_AST_Node::do_oper, which does not have the same defect behavior.
@codecov-io
Copy link

codecov-io commented Mar 5, 2018

Codecov Report

Merging #422 into develop will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #422      +/-   ##
===========================================
+ Coverage    71.99%   71.99%   +<.01%     
===========================================
  Files           59       59              
  Lines        10858    10859       +1     
===========================================
+ Hits          7817     7818       +1     
  Misses        3041     3041
Impacted Files Coverage Δ
include/chaiscript/language/chaiscript_eval.hpp 95.57% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ef47b45...d68ba51. Read the comment docs.

…tatement to compare destroyed objects

Fixes: Class with type_conversion from int and "==" operator causes switch statement to compare destroyed objects ChaiScript#421

Re-uses existing code from Binary_Operator_AST_Node::do_oper to compare equality when processing switch case statements.
@RobLoach
Copy link
Contributor

RobLoach commented Nov 1, 2018

Mind resolving the conflict if this is still relevant? Thanks!

@dinghram
Copy link
Contributor Author

dinghram commented Nov 2, 2018 via email

@lefticus
Copy link
Member

Even with the constexpr changes in place there still one more compiler bug in MSVC, I just sent in a bug report for it, hopefully at some point in the near future we can get it working again.

@dinghram
Copy link
Contributor Author

dinghram commented Dec 28, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants