mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disallow loos assembly in Solidity by permanently setting it to SyntaxError (from Warning)
This commit is contained in:
committed by
Alex Beregszaszi
parent
6003ed2abd
commit
5d9320c70b
+1
-1
@@ -6,5 +6,5 @@ contract test {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (73-74): Top-level expressions are not supposed to return values (this expression returns 1 value). Use ``pop()`` or assign them.
|
||||
// SyntaxError: (73-74): Top-level expressions are not supposed to return values (this expression returns 1 value). Use ``pop()`` or assign them.
|
||||
// DeclarationError: (59-84): Unbalanced stack at the end of a block: 1 surplus item(s).
|
||||
|
||||
+1
-1
@@ -6,5 +6,5 @@ contract test {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (73-76): The use of non-functional instructions is deprecated. Please use functional notation instead.
|
||||
// SyntaxError: (73-76): The use of non-functional instructions is deprecated. Please use functional notation instead.
|
||||
// DeclarationError: (59-86): Unbalanced stack at the end of a block: 1 missing item(s).
|
||||
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract C {
|
||||
function f() pure public {
|
||||
assembly {
|
||||
1
|
||||
}
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// SyntaxError: (105-106): Top-level expressions are not supposed to return values (this expression returns 1 value). Use ``pop()`` or assign them.
|
||||
// DeclarationError: (91-116): Unbalanced stack at the end of a block: 1 surplus item(s).
|
||||
+1
-1
@@ -6,5 +6,5 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (75-76): Top-level expressions are not supposed to return values (this expression returns 1 value). Use ``pop()`` or assign them.
|
||||
// SyntaxError: (75-76): Top-level expressions are not supposed to return values (this expression returns 1 value). Use ``pop()`` or assign them.
|
||||
// DeclarationError: (61-86): Unbalanced stack at the end of a block: 1 surplus item(s).
|
||||
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract C {
|
||||
function f() view public {
|
||||
assembly {
|
||||
address
|
||||
pop
|
||||
}
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// SyntaxError: (105-112): The use of non-functional instructions is deprecated. Please use functional notation instead.
|
||||
// SyntaxError: (125-128): The use of non-functional instructions is deprecated. Please use functional notation instead.
|
||||
+2
-2
@@ -7,5 +7,5 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (75-82): The use of non-functional instructions is deprecated. Please use functional notation instead.
|
||||
// Warning: (95-98): The use of non-functional instructions is deprecated. Please use functional notation instead.
|
||||
// SyntaxError: (75-82): The use of non-functional instructions is deprecated. Please use functional notation instead.
|
||||
// SyntaxError: (95-98): The use of non-functional instructions is deprecated. Please use functional notation instead.
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract C {
|
||||
function f() pure public {
|
||||
assembly {
|
||||
label:
|
||||
}
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// SyntaxError: (105-110): The use of labels is deprecated. Please use "if", "switch", "for" or function calls instead.
|
||||
// SyntaxError: (105-110): Jump instructions and labels are low-level EVM features that can lead to incorrect stack access. Because of that they are discouraged. Please consider using "switch", "if" or "for" statements instead.
|
||||
@@ -6,5 +6,5 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (75-80): The use of labels is deprecated. Please use "if", "switch", "for" or function calls instead.
|
||||
// Warning: (75-80): Jump instructions and labels are low-level EVM features that can lead to incorrect stack access. Because of that they are discouraged. Please consider using "switch", "if" or "for" statements instead.
|
||||
// SyntaxError: (75-80): The use of labels is deprecated. Please use "if", "switch", "for" or function calls instead.
|
||||
// SyntaxError: (75-80): Jump instructions and labels are low-level EVM features that can lead to incorrect stack access. Because of that they are discouraged. Please consider using "switch", "if" or "for" statements instead.
|
||||
|
||||
@@ -6,5 +6,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (75-82): Jump instructions and labels are low-level EVM features that can lead to incorrect stack access. Because of that they are discouraged. Please consider using "switch", "if" or "for" statements instead.
|
||||
// TypeError: (75-82): Function declared as pure, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.
|
||||
// SyntaxError: (75-82): Jump instructions and labels are low-level EVM features that can lead to incorrect stack access. Because of that they are discouraged. Please consider using "switch", "if" or "for" statements instead.
|
||||
|
||||
+1
-1
@@ -6,5 +6,5 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (75-83): Top-level expressions are not supposed to return values (this expression returns 1 value). Use ``pop()`` or assign them.
|
||||
// SyntaxError: (75-83): Top-level expressions are not supposed to return values (this expression returns 1 value). Use ``pop()`` or assign them.
|
||||
// DeclarationError: (61-93): Unbalanced stack at the end of a block: 1 surplus item(s).
|
||||
|
||||
@@ -4,4 +4,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (58-65): Jump instructions and labels are low-level EVM features that can lead to incorrect stack access. Because of that they are discouraged. Please consider using "switch", "if" or "for" statements instead.
|
||||
// SyntaxError: (58-65): Jump instructions and labels are low-level EVM features that can lead to incorrect stack access. Because of that they are discouraged. Please consider using "switch", "if" or "for" statements instead.
|
||||
|
||||
@@ -4,5 +4,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (63-70): Jump instructions and labels are low-level EVM features that can lead to incorrect stack access. Because of that they are discouraged. Please consider using "switch", "if" or "for" statements instead.
|
||||
// TypeError: (63-70): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.
|
||||
// SyntaxError: (63-70): Jump instructions and labels are low-level EVM features that can lead to incorrect stack access. Because of that they are discouraged. Please consider using "switch", "if" or "for" statements instead.
|
||||
|
||||
Reference in New Issue
Block a user