Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Issue 24078019: Fix assertion in the parser about operator precedence. (Closed)

Created:
7 years, 3 months ago by Florian Schneider
Modified:
7 years, 3 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org, Lasse Reichstein Nielsen
Visibility:
Public.

Description

Fix assertion in the parser about operator precedence. R=kmillikin@google.com Committed: https://code.google.com/p/dart/source/detail?r=27625

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -2 lines) Patch
M runtime/vm/parser.cc View 2 chunks +2 lines, -2 lines 4 comments Download

Messages

Total messages: 5 (0 generated)
Florian Schneider
@Lasse: Please run the VM debug tests before landing next time. https://codereview.chromium.org/24078019/diff/1/runtime/vm/parser.cc File runtime/vm/parser.cc (right): ...
7 years, 3 months ago (2013-09-18 15:09:08 UTC) #1
Kevin Millikin (Google)
https://codereview.chromium.org/24078019/diff/1/runtime/vm/parser.cc File runtime/vm/parser.cc (right): https://codereview.chromium.org/24078019/diff/1/runtime/vm/parser.cc#newcode1900 runtime/vm/parser.cc:1900: ASSERT(Token::Precedence(op) >= Token::Precedence(Token::kEQ)); This is OK to fix the ...
7 years, 3 months ago (2013-09-18 15:13:21 UTC) #2
Kevin Millikin (Google)
lgtm
7 years, 3 months ago (2013-09-18 15:13:27 UTC) #3
Florian Schneider
Committed patchset #1 manually as r27625 (presubmit successful).
7 years, 3 months ago (2013-09-18 15:17:04 UTC) #4
hausner
7 years, 3 months ago (2013-09-18 15:52:36 UTC) #5
Message was sent while issue was closed.
lgtm

https://codereview.chromium.org/24078019/diff/1/runtime/vm/parser.cc
File runtime/vm/parser.cc (right):

https://codereview.chromium.org/24078019/diff/1/runtime/vm/parser.cc#newcode1890
runtime/vm/parser.cc:1890: (CurrentToken() == Token::kNE));
On 2013/09/18 15:09:09, Florian Schneider wrote:
> Could the ASSERT below even be removed since this assertion already asserts
> valid super-operators?

If somebody decides tomorrow that the conditional operator should be
overloadable then this code breaks. That would be caught by the assertion below.

https://codereview.chromium.org/24078019/diff/1/runtime/vm/parser.cc#newcode1900
runtime/vm/parser.cc:1900: ASSERT(Token::Precedence(op) >=
Token::Precedence(Token::kEQ));
We are blindly calling ParseBinaryExpr() here, so we better make sure that the
operator can be handled by that function. That's what this assert is about.
Maybe you find it a bit less annoying now.


On 2013/09/18 15:13:21, kmillikin wrote:
> This is OK to fix the tests.
> 
> It's kind of annoying to assert anything about precedence or to rely
> specifically on a particular operator's precedence.
> 
> I probably find that annoying because overriding operators has basically
nothing
> at all to do with precedence.

Powered by Google App Engine
This is Rietveld 408576698