text
stringlengths
19
585k
label
stringclasses
2 values
category
stringclasses
2 values
language
stringclasses
14 values
repo
stringclasses
932 values
sha
stringlengths
40
40
@@ -174,75 +212,697 @@ impl AbstractInstructionSet { } } - // Some ops are known to produce certain results, interpret them here. - let interpreted_op = match &op.opcode { + // This macro must be declared here to be able to capture some variables + ...
bad
review
rust
FuelLabs/sway
2765f4af57abc203a826d5890c77e4593c6095ff
diff --git a/sway-core/src/asm_generation/fuel/optimizations/constant_propagate.rs b/sway-core/src/asm_generation/fuel/optimizations/constant_propagate.rs index 1f0a93772bb..90ecbdb9768 100644 --- a/sway-core/src/asm_generation/fuel/optimizations/constant_propagate.rs +++ b/sway-core/src/asm_generation/fuel/optimizatio...
good
review_fixed
rust
FuelLabs/sway
2765f4af57abc203a826d5890c77e4593c6095ff
@@ -174,75 +212,697 @@ impl AbstractInstructionSet { } } - // Some ops are known to produce certain results, interpret them here. - let interpreted_op = match &op.opcode { + // This macro must be declared here to be able to capture some variables + ...
bad
review
rust
FuelLabs/sway
2765f4af57abc203a826d5890c77e4593c6095ff
diff --git a/sway-core/src/asm_generation/fuel/optimizations/constant_propagate.rs b/sway-core/src/asm_generation/fuel/optimizations/constant_propagate.rs index 1f0a93772bb..90ecbdb9768 100644 --- a/sway-core/src/asm_generation/fuel/optimizations/constant_propagate.rs +++ b/sway-core/src/asm_generation/fuel/optimizatio...
good
review_fixed
rust
FuelLabs/sway
2765f4af57abc203a826d5890c77e4593c6095ff
@@ -174,75 +212,697 @@ impl AbstractInstructionSet { } } - // Some ops are known to produce certain results, interpret them here. - let interpreted_op = match &op.opcode { + // This macro must be declared here to be able to capture some variables + ...
bad
review
rust
FuelLabs/sway
2765f4af57abc203a826d5890c77e4593c6095ff
diff --git a/sway-core/src/asm_generation/fuel/optimizations/constant_propagate.rs b/sway-core/src/asm_generation/fuel/optimizations/constant_propagate.rs index 1f0a93772bb..90ecbdb9768 100644 --- a/sway-core/src/asm_generation/fuel/optimizations/constant_propagate.rs +++ b/sway-core/src/asm_generation/fuel/optimizatio...
good
review_fixed
rust
FuelLabs/sway
2765f4af57abc203a826d5890c77e4593c6095ff
@@ -174,75 +204,697 @@ impl AbstractInstructionSet { } } - // Some ops are known to produce certain results, interpret them here. - let interpreted_op = match &op.opcode { + // This macro must be declared here to be able to capture some variables + ...
bad
review
rust
FuelLabs/sway
2765f4af57abc203a826d5890c77e4593c6095ff
diff --git a/sway-core/src/asm_generation/fuel/optimizations/constant_propagate.rs b/sway-core/src/asm_generation/fuel/optimizations/constant_propagate.rs index 1f0a93772bb..90ecbdb9768 100644 --- a/sway-core/src/asm_generation/fuel/optimizations/constant_propagate.rs +++ b/sway-core/src/asm_generation/fuel/optimizatio...
good
review_fixed
rust
FuelLabs/sway
2765f4af57abc203a826d5890c77e4593c6095ff
@@ -174,75 +204,697 @@ impl AbstractInstructionSet { } } - // Some ops are known to produce certain results, interpret them here. - let interpreted_op = match &op.opcode { + // This macro must be declared here to be able to capture some variables + ...
bad
review
rust
FuelLabs/sway
2765f4af57abc203a826d5890c77e4593c6095ff
diff --git a/sway-core/src/asm_generation/fuel/optimizations/constant_propagate.rs b/sway-core/src/asm_generation/fuel/optimizations/constant_propagate.rs index 1f0a93772bb..90ecbdb9768 100644 --- a/sway-core/src/asm_generation/fuel/optimizations/constant_propagate.rs +++ b/sway-core/src/asm_generation/fuel/optimizatio...
good
review_fixed
rust
FuelLabs/sway
2765f4af57abc203a826d5890c77e4593c6095ff
@@ -174,75 +204,697 @@ impl AbstractInstructionSet { } } - // Some ops are known to produce certain results, interpret them here. - let interpreted_op = match &op.opcode { + // This macro must be declared here to be able to capture some variables + ...
bad
review
rust
FuelLabs/sway
2765f4af57abc203a826d5890c77e4593c6095ff
diff --git a/sway-core/src/asm_generation/fuel/optimizations/constant_propagate.rs b/sway-core/src/asm_generation/fuel/optimizations/constant_propagate.rs index 1f0a93772bb..90ecbdb9768 100644 --- a/sway-core/src/asm_generation/fuel/optimizations/constant_propagate.rs +++ b/sway-core/src/asm_generation/fuel/optimizatio...
good
review_fixed
rust
FuelLabs/sway
2765f4af57abc203a826d5890c77e4593c6095ff
@@ -700,20 +710,24 @@ impl Op { } /// Returns a list of all registers *read* by instruction `self`. - pub(crate) fn use_registers_mut(&mut self) -> BTreeSet<&mut VirtualRegister> { + pub(crate) fn use_registers_mut(&mut self) -> Vec<&mut VirtualRegister> { match &mut self.opcode { ...
bad
review
rust
FuelLabs/sway
2765f4af57abc203a826d5890c77e4593c6095ff
diff --git a/sway-core/src/asm_lang/mod.rs b/sway-core/src/asm_lang/mod.rs index 805470d600f..cc302e5fe37 100644 --- a/sway-core/src/asm_lang/mod.rs +++ b/sway-core/src/asm_lang/mod.rs @@ -94,6 +94,16 @@ pub(crate) struct Op { pub(crate) owning_span: Option<Span>, } +impl From<VirtualOp> for Op { + fn from(o...
good
review_fixed
rust
FuelLabs/sway
2765f4af57abc203a826d5890c77e4593c6095ff
@@ -249,6 +249,142 @@ pub(crate) enum VirtualOp { } impl VirtualOp { + pub fn r#move(a: impl Into<VirtualRegister>, b: impl Into<VirtualRegister>) -> VirtualOp { + VirtualOp::MOVE(a.into(), b.into()) + } + + pub fn r#movi(a: impl Into<VirtualRegister>, b: impl Into<VirtualImmediate18>) -> VirtualOp ...
bad
review
rust
FuelLabs/sway
2765f4af57abc203a826d5890c77e4593c6095ff
diff --git a/sway-core/src/asm_lang/virtual_ops.rs b/sway-core/src/asm_lang/virtual_ops.rs index 57ac24ff488..f5a6a2dba6d 100644 --- a/sway-core/src/asm_lang/virtual_ops.rs +++ b/sway-core/src/asm_lang/virtual_ops.rs @@ -249,6 +249,146 @@ pub(crate) enum VirtualOp { } impl VirtualOp { + pub fn r#move(a: impl Int...
good
review_fixed
rust
FuelLabs/sway
2765f4af57abc203a826d5890c77e4593c6095ff
@@ -480,7 +616,8 @@ impl VirtualOp { } } - // What are the special registers that an OP may set. + /// What are the special registers that an OP may set. + /// Examples: Error, Overflow, Flags etc...
bad
review
rust
FuelLabs/sway
2765f4af57abc203a826d5890c77e4593c6095ff
diff --git a/sway-core/src/asm_lang/virtual_ops.rs b/sway-core/src/asm_lang/virtual_ops.rs index 57ac24ff488..f5a6a2dba6d 100644 --- a/sway-core/src/asm_lang/virtual_ops.rs +++ b/sway-core/src/asm_lang/virtual_ops.rs @@ -249,6 +249,146 @@ pub(crate) enum VirtualOp { } impl VirtualOp { + pub fn r#move(a: impl Int...
good
review_fixed
rust
FuelLabs/sway
2765f4af57abc203a826d5890c77e4593c6095ff
@@ -1201,6 +1201,7 @@ fn get_trait_fn_node_index<'a>( /// connects any inner parts of an expression to the graph /// note the main expression node has already been inserted #[allow(clippy::too_many_arguments)] +#[allow(unused_assignments)] // Clippy's false positive on the `previous_force_struct_fields_connection`.
bad
review
rust
FuelLabs/sway
cea3271f8288104865bae95d083a511353ee3117
diff --git a/sway-core/src/control_flow_analysis/dead_code_analysis.rs b/sway-core/src/control_flow_analysis/dead_code_analysis.rs index eba1658ba2f..2e0dcf09d30 100644 --- a/sway-core/src/control_flow_analysis/dead_code_analysis.rs +++ b/sway-core/src/control_flow_analysis/dead_code_analysis.rs @@ -429,7 +429,6 @@ fn ...
good
review_fixed
rust
FuelLabs/sway
cea3271f8288104865bae95d083a511353ee3117
@@ -1405,7 +1401,6 @@ fn connect_expression<'eng: 'cfg, 'cfg>( param_leaves = vec![]; } } - options.force_struct_fields_connection = force_struct_fields_connection;
bad
review
rust
FuelLabs/sway
cea3271f8288104865bae95d083a511353ee3117
diff --git a/sway-core/src/control_flow_analysis/dead_code_analysis.rs b/sway-core/src/control_flow_analysis/dead_code_analysis.rs index eba1658ba2f..2e0dcf09d30 100644 --- a/sway-core/src/control_flow_analysis/dead_code_analysis.rs +++ b/sway-core/src/control_flow_analysis/dead_code_analysis.rs @@ -429,7 +429,6 @@ fn ...
good
review_fixed
rust
FuelLabs/sway
cea3271f8288104865bae95d083a511353ee3117
@@ -468,6 +471,8 @@ impl AllocatedAbstractInstructionSet { "fix me, pushall and popall don't really belong in control flow ops \ since they're not about control flow" ), + + Either::Right(JumpToAddr(..)) => 1,
bad
review
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
diff --git a/sway-core/src/asm_generation/fuel/allocated_abstract_instruction_set.rs b/sway-core/src/asm_generation/fuel/allocated_abstract_instruction_set.rs index e8f76595c03..abdfde3511e 100644 --- a/sway-core/src/asm_generation/fuel/allocated_abstract_instruction_set.rs +++ b/sway-core/src/asm_generation/fuel/alloc...
good
review_fixed
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
@@ -1354,6 +1304,8 @@ impl<Reg: fmt::Display> fmt::Display for ControlFlowOp<Reg> { "CONFIGURABLES_OFFSET[0..32]\nCONFIGURABLES_OFFSET[32..64]".into(), PushAll(lab) => format!("pusha {lab}"), PopAll(lab) => format!("popa {lab}"), + JumpToAddr(r0) => ...
bad
review
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
diff --git a/sway-core/src/asm_lang/mod.rs b/sway-core/src/asm_lang/mod.rs index 8a2f75fd761..805470d600f 100644 --- a/sway-core/src/asm_lang/mod.rs +++ b/sway-core/src/asm_lang/mod.rs @@ -441,54 +441,6 @@ impl Op { } /* Control Flow Instructions */ - "jmp" => { - l...
good
review_fixed
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
@@ -15,6 +15,12 @@ impl AbstractInstructionSet { let mut cur_live = BTreeSet::default(); let mut dead_indices = FxHashSet::default(); for (rev_ix, op) in ops.iter().rev().enumerate() { + // We cannot guarantee the jump will not end in a
bad
review
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
diff --git a/sway-core/src/asm_generation/fuel/optimizations/reachability.rs b/sway-core/src/asm_generation/fuel/optimizations/reachability.rs index d7febb94a83..807208dd877 100644 --- a/sway-core/src/asm_generation/fuel/optimizations/reachability.rs +++ b/sway-core/src/asm_generation/fuel/optimizations/reachability.rs...
good
review_fixed
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
@@ -80,8 +86,16 @@ impl AbstractInstructionSet { // Keep track of a map between jump labels and op indices. Useful to compute op successors. let mut label_to_index: HashMap<Label, usize> = HashMap::default(); for (idx, op) in ops.iter().enumerate() { - if let Either::Right(ControlF...
bad
review
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
diff --git a/sway-core/src/asm_generation/fuel/optimizations/reachability.rs b/sway-core/src/asm_generation/fuel/optimizations/reachability.rs index d7febb94a83..807208dd877 100644 --- a/sway-core/src/asm_generation/fuel/optimizations/reachability.rs +++ b/sway-core/src/asm_generation/fuel/optimizations/reachability.rs...
good
review_fixed
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
@@ -441,54 +441,6 @@ impl Op { } /* Control Flow Instructions */ - "jmp" => {
bad
review
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
diff --git a/sway-core/src/asm_lang/mod.rs b/sway-core/src/asm_lang/mod.rs index 8a2f75fd761..805470d600f 100644 --- a/sway-core/src/asm_lang/mod.rs +++ b/sway-core/src/asm_lang/mod.rs @@ -441,54 +441,6 @@ impl Op { } /* Control Flow Instructions */ - "jmp" => { - l...
good
review_fixed
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
@@ -1,19 +1,40 @@ -use std::collections::HashSet; - -use sway_error::error::CompileError; -use sway_types::Span; - use crate::{ asm_generation::fuel::abstract_instruction_set::AbstractInstructionSet, - asm_lang::VirtualRegister, + asm_lang::{ConstantRegister, ControlFlowOp, VirtualRegister}, }; +use either...
bad
review
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
diff --git a/sway-core/src/asm_generation/fuel/optimizations/verify.rs b/sway-core/src/asm_generation/fuel/optimizations/verify.rs index 4b3c03b6b55..cdef3fb5409 100644 --- a/sway-core/src/asm_generation/fuel/optimizations/verify.rs +++ b/sway-core/src/asm_generation/fuel/optimizations/verify.rs @@ -1,19 +1,40 @@ -use ...
good
review_fixed
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
@@ -1,19 +1,40 @@ -use std::collections::HashSet; - -use sway_error::error::CompileError; -use sway_types::Span; - use crate::{ asm_generation::fuel::abstract_instruction_set::AbstractInstructionSet, - asm_lang::VirtualRegister, + asm_lang::{ConstantRegister, ControlFlowOp, VirtualRegister}, }; +use either...
bad
review
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
diff --git a/sway-core/src/asm_generation/fuel/optimizations/verify.rs b/sway-core/src/asm_generation/fuel/optimizations/verify.rs index 4b3c03b6b55..cdef3fb5409 100644 --- a/sway-core/src/asm_generation/fuel/optimizations/verify.rs +++ b/sway-core/src/asm_generation/fuel/optimizations/verify.rs @@ -1,19 +1,40 @@ -use ...
good
review_fixed
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
@@ -330,7 +330,32 @@ impl AllocatedAbstractInstructionSet { } ControlFlowOp::Comment => continue, ControlFlowOp::Label(..) => continue, - + ControlFlowOp::JumpToAddr(reg) => { + realized_ops.push(RealizedOp { + ...
bad
review
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
diff --git a/sway-core/src/asm_generation/fuel/allocated_abstract_instruction_set.rs b/sway-core/src/asm_generation/fuel/allocated_abstract_instruction_set.rs index e8f76595c03..abdfde3511e 100644 --- a/sway-core/src/asm_generation/fuel/allocated_abstract_instruction_set.rs +++ b/sway-core/src/asm_generation/fuel/alloc...
good
review_fixed
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
@@ -3186,40 +3186,37 @@ fn check_asm_block_validity( .map(|reg_name| VirtualRegister::Virtual(reg_name.to_string())) .collect::<Vec<VirtualRegister>>(); - opcodes.push(( - crate::asm_lang::Op::parse_opcode( - handler, - &op.op_name, - ...
bad
review
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
diff --git a/sway-core/src/semantic_analysis/ast_node/expression/typed_expression.rs b/sway-core/src/semantic_analysis/ast_node/expression/typed_expression.rs index 98800af7cca..dc3565a0d00 100644 --- a/sway-core/src/semantic_analysis/ast_node/expression/typed_expression.rs +++ b/sway-core/src/semantic_analysis/ast_nod...
good
review_fixed
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
@@ -1487,6 +1455,9 @@ impl<Reg: Clone + Eq + Ord + Hash> ControlFlowOp<Reg> { } } }, + // Impossible to know, so we return empty.
bad
review
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
diff --git a/sway-core/src/asm_lang/mod.rs b/sway-core/src/asm_lang/mod.rs index 8a2f75fd761..805470d600f 100644 --- a/sway-core/src/asm_lang/mod.rs +++ b/sway-core/src/asm_lang/mod.rs @@ -441,54 +441,6 @@ impl Op { } /* Control Flow Instructions */ - "jmp" => { - l...
good
review_fixed
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
@@ -440,6 +468,313 @@ fn run_cmds( Ok(()) } +fn fuel_vm_command(snapshot: &mut String, args: &str) -> Result<(), std::io::Error> { + let mut args = args.split(" "); + match args.next() { + Some("run") => { + let bin_file = args.next().unwrap(); + + let bytecode = std::fs::read...
bad
review
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
diff --git a/test/src/snapshot/mod.rs b/test/src/snapshot/mod.rs index 767c254d041..78a72e4be4e 100644 --- a/test/src/snapshot/mod.rs +++ b/test/src/snapshot/mod.rs @@ -1,9 +1,22 @@ use anyhow::Result; +use fuel_vm::{ + prelude::{GasCostsValues, TransactionBuilderExt as _}, + state::ProgramState, + storage::M...
good
review_fixed
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
@@ -440,6 +464,270 @@ fn run_cmds( Ok(()) } +/// FuelVM commands: +/// run: will run the specified binary beginning to end. +/// Will also print the gas used and all receipts to the +/// snapshot. +fn fuel_vm_command(snapshot: &mut String, args: &str) -> Result<(), std::io::Error> { + let mut args = args...
bad
review
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
diff --git a/test/src/snapshot/mod.rs b/test/src/snapshot/mod.rs index 767c254d041..78a72e4be4e 100644 --- a/test/src/snapshot/mod.rs +++ b/test/src/snapshot/mod.rs @@ -1,9 +1,22 @@ use anyhow::Result; +use fuel_vm::{ + prelude::{GasCostsValues, TransactionBuilderExt as _}, + state::ProgramState, + storage::M...
good
review_fixed
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
@@ -440,6 +463,270 @@ fn run_cmds( Ok(()) } +/// FuelVM commands: +/// run: will run the specified binary beginning to end. +/// Will also print the gas used and all receipts to the +/// snapshot. +fn fuel_vm_command(snapshot: &mut String, args: &str) -> Result<(), std::io::Error> { + let mut args = args...
bad
review
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
diff --git a/test/src/snapshot/mod.rs b/test/src/snapshot/mod.rs index 767c254d041..78a72e4be4e 100644 --- a/test/src/snapshot/mod.rs +++ b/test/src/snapshot/mod.rs @@ -1,9 +1,22 @@ use anyhow::Result; +use fuel_vm::{ + prelude::{GasCostsValues, TransactionBuilderExt as _}, + state::ProgramState, + storage::M...
good
review_fixed
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
@@ -330,7 +330,32 @@ impl AllocatedAbstractInstructionSet { } ControlFlowOp::Comment => continue, ControlFlowOp::Label(..) => continue, - + ControlFlowOp::JumpToAddr(reg) => { + realized_ops.push(RealizedOp { + ...
bad
review
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
diff --git a/sway-core/src/asm_generation/fuel/allocated_abstract_instruction_set.rs b/sway-core/src/asm_generation/fuel/allocated_abstract_instruction_set.rs index e8f76595c03..abdfde3511e 100644 --- a/sway-core/src/asm_generation/fuel/allocated_abstract_instruction_set.rs +++ b/sway-core/src/asm_generation/fuel/alloc...
good
review_fixed
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
@@ -1389,17 +1346,19 @@ impl<Reg: Clone + Eq + Ord + Hash> ControlFlowOp<Reg> { | ConfigurablesOffsetPlaceholder | PushAll(_) | PopAll(_) => vec![], - Jump { type_, .. } => match type_ { JumpType::Unconditional => vec![], JumpType::No...
bad
review
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
diff --git a/sway-core/src/asm_lang/mod.rs b/sway-core/src/asm_lang/mod.rs index 8a2f75fd761..805470d600f 100644 --- a/sway-core/src/asm_lang/mod.rs +++ b/sway-core/src/asm_lang/mod.rs @@ -441,54 +441,6 @@ impl Op { } /* Control Flow Instructions */ - "jmp" => { - l...
good
review_fixed
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
@@ -0,0 +1,9 @@ +[project] +authors = ["Fuel Labs <contact@fuel.sh>"] +entry = "main.sw" +license = "Apache-2.0" +name = "asm_patch" +implicit-std = false + +[dependencies] +std = { path = "../../../../../reduced_std_libs/sway-lib-std-assert" }
bad
review
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/asm_patch/Forc.toml b/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/asm_patch/Forc.toml new file mode 100644 index 00000000000..5277747c59f --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/asm_patch/...
good
review_fixed
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
@@ -356,6 +369,16 @@ fn run_cmds( snapshot.push('\n'); + continue; + } else if let Some(args) = cmd.strip_prefix("patch-bin ") { + if let Err(err) = patch_bin_command(repo_root, root, args) { + snaps...
bad
review
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
diff --git a/test/src/snapshot/mod.rs b/test/src/snapshot/mod.rs index 767c254d041..78a72e4be4e 100644 --- a/test/src/snapshot/mod.rs +++ b/test/src/snapshot/mod.rs @@ -1,9 +1,22 @@ use anyhow::Result; +use fuel_vm::{ + prelude::{GasCostsValues, TransactionBuilderExt as _}, + state::ProgramState, + storage::M...
good
review_fixed
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
@@ -3186,40 +3186,37 @@ fn check_asm_block_validity( .map(|reg_name| VirtualRegister::Virtual(reg_name.to_string())) .collect::<Vec<VirtualRegister>>(); - opcodes.push(( - crate::asm_lang::Op::parse_opcode( - handler, - &op.op_name, - ...
bad
review
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
diff --git a/sway-core/src/semantic_analysis/ast_node/expression/typed_expression.rs b/sway-core/src/semantic_analysis/ast_node/expression/typed_expression.rs index 98800af7cca..dc3565a0d00 100644 --- a/sway-core/src/semantic_analysis/ast_node/expression/typed_expression.rs +++ b/sway-core/src/semantic_analysis/ast_nod...
good
review_fixed
rust
FuelLabs/sway
4e4d13296c762c0c010586231b4e4be667f428a2
@@ -1,30 +1,94 @@ -pub mod cli; pub mod doc; pub mod render; pub mod search; -pub mod tests; use anyhow::{bail, Result}; -use cli::Command; +use clap::Parser; use doc::Documentation; -use forc_pkg as pkg; use forc_pkg::{ + self as pkg, manifest::{GenericManifestFile, ManifestFile}, - PackageManifestF...
bad
review
rust
FuelLabs/sway
7e4be669bb2e8a45aab16b92e4360437d3628362
diff --git a/forc-plugins/forc-doc/src/lib.rs b/forc-plugins/forc-doc/src/lib.rs index a264481a8f3..af3b5d20840 100644 --- a/forc-plugins/forc-doc/src/lib.rs +++ b/forc-plugins/forc-doc/src/lib.rs @@ -1,21 +1,19 @@ -pub mod cli; pub mod doc; pub mod render; pub mod search; -pub mod tests; use anyhow::{bail, Resul...
good
review_fixed
rust
FuelLabs/sway
7e4be669bb2e8a45aab16b92e4360437d3628362
@@ -1,30 +1,94 @@ -pub mod cli; pub mod doc; pub mod render; pub mod search; -pub mod tests; use anyhow::{bail, Result}; -use cli::Command; +use clap::Parser; use doc::Documentation; -use forc_pkg as pkg; use forc_pkg::{ + self as pkg, manifest::{GenericManifestFile, ManifestFile}, - PackageManifestF...
bad
review
rust
FuelLabs/sway
7e4be669bb2e8a45aab16b92e4360437d3628362
diff --git a/forc-plugins/forc-doc/src/lib.rs b/forc-plugins/forc-doc/src/lib.rs index a264481a8f3..af3b5d20840 100644 --- a/forc-plugins/forc-doc/src/lib.rs +++ b/forc-plugins/forc-doc/src/lib.rs @@ -1,21 +1,19 @@ -pub mod cli; pub mod doc; pub mod render; pub mod search; -pub mod tests; use anyhow::{bail, Resul...
good
review_fixed
rust
FuelLabs/sway
7e4be669bb2e8a45aab16b92e4360437d3628362
@@ -38,61 +42,99 @@ public Size constrain(VideoConstraints constraints) { public Size constrain(VideoConstraints constraints, boolean preserveAspectRatio) { int maxSize = constraints.getMaxSize(); int alignment = constraints.getAlignment(); + MediaCodecInfo.VideoCapabilities caps = constra...
bad
review
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
diff --git a/server/src/main/java/com/genymobile/scrcpy/model/Size.java b/server/src/main/java/com/genymobile/scrcpy/model/Size.java index 63648a9e8f..51211969e2 100644 --- a/server/src/main/java/com/genymobile/scrcpy/model/Size.java +++ b/server/src/main/java/com/genymobile/scrcpy/model/Size.java @@ -1,8 +1,12 @@ pac...
good
review_fixed
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
@@ -38,61 +42,99 @@ public Size constrain(VideoConstraints constraints) { public Size constrain(VideoConstraints constraints, boolean preserveAspectRatio) { int maxSize = constraints.getMaxSize(); int alignment = constraints.getAlignment(); + MediaCodecInfo.VideoCapabilities caps = constra...
bad
review
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
diff --git a/server/src/main/java/com/genymobile/scrcpy/model/Size.java b/server/src/main/java/com/genymobile/scrcpy/model/Size.java index 63648a9e8f..51211969e2 100644 --- a/server/src/main/java/com/genymobile/scrcpy/model/Size.java +++ b/server/src/main/java/com/genymobile/scrcpy/model/Size.java @@ -1,8 +1,12 @@ pac...
good
review_fixed
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
@@ -38,61 +42,99 @@ public Size constrain(VideoConstraints constraints) { public Size constrain(VideoConstraints constraints, boolean preserveAspectRatio) { int maxSize = constraints.getMaxSize(); int alignment = constraints.getAlignment(); + MediaCodecInfo.VideoCapabilities caps = constra...
bad
review
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
diff --git a/server/src/main/java/com/genymobile/scrcpy/model/Size.java b/server/src/main/java/com/genymobile/scrcpy/model/Size.java index 63648a9e8f..51211969e2 100644 --- a/server/src/main/java/com/genymobile/scrcpy/model/Size.java +++ b/server/src/main/java/com/genymobile/scrcpy/model/Size.java @@ -1,8 +1,12 @@ pac...
good
review_fixed
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
@@ -38,61 +42,99 @@ public Size constrain(VideoConstraints constraints) { public Size constrain(VideoConstraints constraints, boolean preserveAspectRatio) { int maxSize = constraints.getMaxSize(); int alignment = constraints.getAlignment(); + MediaCodecInfo.VideoCapabilities caps = constra...
bad
review
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
diff --git a/server/src/main/java/com/genymobile/scrcpy/model/Size.java b/server/src/main/java/com/genymobile/scrcpy/model/Size.java index 63648a9e8f..51211969e2 100644 --- a/server/src/main/java/com/genymobile/scrcpy/model/Size.java +++ b/server/src/main/java/com/genymobile/scrcpy/model/Size.java @@ -1,8 +1,12 @@ pac...
good
review_fixed
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
@@ -38,61 +42,99 @@ public Size constrain(VideoConstraints constraints) { public Size constrain(VideoConstraints constraints, boolean preserveAspectRatio) { int maxSize = constraints.getMaxSize(); int alignment = constraints.getAlignment(); + MediaCodecInfo.VideoCapabilities caps = constra...
bad
review
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
diff --git a/server/src/main/java/com/genymobile/scrcpy/model/Size.java b/server/src/main/java/com/genymobile/scrcpy/model/Size.java index 63648a9e8f..51211969e2 100644 --- a/server/src/main/java/com/genymobile/scrcpy/model/Size.java +++ b/server/src/main/java/com/genymobile/scrcpy/model/Size.java @@ -1,8 +1,12 @@ pac...
good
review_fixed
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
@@ -38,61 +42,99 @@ public Size constrain(VideoConstraints constraints) { public Size constrain(VideoConstraints constraints, boolean preserveAspectRatio) { int maxSize = constraints.getMaxSize(); int alignment = constraints.getAlignment(); + MediaCodecInfo.VideoCapabilities caps = constra...
bad
review
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
diff --git a/server/src/main/java/com/genymobile/scrcpy/model/Size.java b/server/src/main/java/com/genymobile/scrcpy/model/Size.java index 63648a9e8f..51211969e2 100644 --- a/server/src/main/java/com/genymobile/scrcpy/model/Size.java +++ b/server/src/main/java/com/genymobile/scrcpy/model/Size.java @@ -1,8 +1,12 @@ pac...
good
review_fixed
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
@@ -38,61 +42,99 @@ public Size constrain(VideoConstraints constraints) { public Size constrain(VideoConstraints constraints, boolean preserveAspectRatio) { int maxSize = constraints.getMaxSize(); int alignment = constraints.getAlignment(); + MediaCodecInfo.VideoCapabilities caps = constra...
bad
review
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
diff --git a/server/src/main/java/com/genymobile/scrcpy/model/Size.java b/server/src/main/java/com/genymobile/scrcpy/model/Size.java index 63648a9e8f..51211969e2 100644 --- a/server/src/main/java/com/genymobile/scrcpy/model/Size.java +++ b/server/src/main/java/com/genymobile/scrcpy/model/Size.java @@ -1,8 +1,12 @@ pac...
good
review_fixed
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
@@ -0,0 +1,45 @@ +package com.genymobile.scrcpy.util; + +import com.genymobile.scrcpy.AndroidVersions; + +import android.annotation.TargetApi; + +import java.util.function.Predicate; + +public final class BinarySearch { + private BinarySearch() { + // not instantiable + } + + /** + * Find the last v...
bad
review
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
diff --git a/server/src/main/java/com/genymobile/scrcpy/util/BinarySearch.java b/server/src/main/java/com/genymobile/scrcpy/util/BinarySearch.java new file mode 100644 index 0000000000..381601fefd --- /dev/null +++ b/server/src/main/java/com/genymobile/scrcpy/util/BinarySearch.java @@ -0,0 +1,53 @@ +package com.genymob...
good
review_fixed
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
@@ -0,0 +1,45 @@ +package com.genymobile.scrcpy.util; + +import com.genymobile.scrcpy.AndroidVersions; + +import android.annotation.TargetApi; + +import java.util.function.Predicate; + +public final class BinarySearch { + private BinarySearch() { + // not instantiable + } + + /** + * Find the last v...
bad
review
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
diff --git a/server/src/main/java/com/genymobile/scrcpy/util/BinarySearch.java b/server/src/main/java/com/genymobile/scrcpy/util/BinarySearch.java new file mode 100644 index 0000000000..381601fefd --- /dev/null +++ b/server/src/main/java/com/genymobile/scrcpy/util/BinarySearch.java @@ -0,0 +1,53 @@ +package com.genymob...
good
review_fixed
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
@@ -0,0 +1,45 @@ +package com.genymobile.scrcpy.util; + +import com.genymobile.scrcpy.AndroidVersions; + +import android.annotation.TargetApi; + +import java.util.function.Predicate; + +public final class BinarySearch { + private BinarySearch() { + // not instantiable + } + + /** + * Find the last v...
bad
review
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
diff --git a/server/src/main/java/com/genymobile/scrcpy/util/BinarySearch.java b/server/src/main/java/com/genymobile/scrcpy/util/BinarySearch.java new file mode 100644 index 0000000000..381601fefd --- /dev/null +++ b/server/src/main/java/com/genymobile/scrcpy/util/BinarySearch.java @@ -0,0 +1,53 @@ +package com.genymob...
good
review_fixed
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
@@ -0,0 +1,45 @@ +package com.genymobile.scrcpy.util; + +import com.genymobile.scrcpy.AndroidVersions; + +import android.annotation.TargetApi; + +import java.util.function.Predicate; + +public final class BinarySearch { + private BinarySearch() { + // not instantiable + } + + /** + * Find the last v...
bad
review
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
diff --git a/server/src/main/java/com/genymobile/scrcpy/util/BinarySearch.java b/server/src/main/java/com/genymobile/scrcpy/util/BinarySearch.java new file mode 100644 index 0000000000..381601fefd --- /dev/null +++ b/server/src/main/java/com/genymobile/scrcpy/util/BinarySearch.java @@ -0,0 +1,53 @@ +package com.genymob...
good
review_fixed
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
@@ -38,61 +42,99 @@ public Size constrain(VideoConstraints constraints) { public Size constrain(VideoConstraints constraints, boolean preserveAspectRatio) { int maxSize = constraints.getMaxSize(); int alignment = constraints.getAlignment(); + MediaCodecInfo.VideoCapabilities caps = constra...
bad
review
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
diff --git a/server/src/main/java/com/genymobile/scrcpy/model/Size.java b/server/src/main/java/com/genymobile/scrcpy/model/Size.java index 63648a9e8f..51211969e2 100644 --- a/server/src/main/java/com/genymobile/scrcpy/model/Size.java +++ b/server/src/main/java/com/genymobile/scrcpy/model/Size.java @@ -1,8 +1,12 @@ pac...
good
review_fixed
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
@@ -0,0 +1,53 @@ +package com.genymobile.scrcpy.util; + +import com.genymobile.scrcpy.AndroidVersions; + +import android.annotation.TargetApi; + +import java.util.function.Predicate; + +public final class BinarySearch { + private BinarySearch() { + // not instantiable + } + + /** + * Find the highes...
bad
review
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
diff --git a/server/src/main/java/com/genymobile/scrcpy/util/BinarySearch.java b/server/src/main/java/com/genymobile/scrcpy/util/BinarySearch.java new file mode 100644 index 0000000000..381601fefd --- /dev/null +++ b/server/src/main/java/com/genymobile/scrcpy/util/BinarySearch.java @@ -0,0 +1,53 @@ +package com.genymob...
good
review_fixed
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
@@ -38,61 +42,107 @@ public Size constrain(VideoConstraints constraints) { public Size constrain(VideoConstraints constraints, boolean preserveAspectRatio) { int maxSize = constraints.getMaxSize(); int alignment = constraints.getAlignment(); + MediaCodecInfo.VideoCapabilities caps = constr...
bad
review
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
diff --git a/server/src/main/java/com/genymobile/scrcpy/model/Size.java b/server/src/main/java/com/genymobile/scrcpy/model/Size.java index 63648a9e8f..51211969e2 100644 --- a/server/src/main/java/com/genymobile/scrcpy/model/Size.java +++ b/server/src/main/java/com/genymobile/scrcpy/model/Size.java @@ -1,8 +1,12 @@ pac...
good
review_fixed
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
@@ -38,61 +42,111 @@ public Size constrain(VideoConstraints constraints) { public Size constrain(VideoConstraints constraints, boolean preserveAspectRatio) { int maxSize = constraints.getMaxSize(); int alignment = constraints.getAlignment(); + MediaCodecInfo.VideoCapabilities caps = constr...
bad
review
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
diff --git a/server/src/main/java/com/genymobile/scrcpy/model/Size.java b/server/src/main/java/com/genymobile/scrcpy/model/Size.java index 63648a9e8f..51211969e2 100644 --- a/server/src/main/java/com/genymobile/scrcpy/model/Size.java +++ b/server/src/main/java/com/genymobile/scrcpy/model/Size.java @@ -1,8 +1,12 @@ pac...
good
review_fixed
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
@@ -38,61 +42,111 @@ public Size constrain(VideoConstraints constraints) { public Size constrain(VideoConstraints constraints, boolean preserveAspectRatio) { int maxSize = constraints.getMaxSize(); int alignment = constraints.getAlignment(); + MediaCodecInfo.VideoCapabilities caps = constr...
bad
review
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
diff --git a/server/src/main/java/com/genymobile/scrcpy/model/Size.java b/server/src/main/java/com/genymobile/scrcpy/model/Size.java index 63648a9e8f..51211969e2 100644 --- a/server/src/main/java/com/genymobile/scrcpy/model/Size.java +++ b/server/src/main/java/com/genymobile/scrcpy/model/Size.java @@ -1,8 +1,12 @@ pac...
good
review_fixed
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
@@ -38,61 +42,111 @@ public Size constrain(VideoConstraints constraints) { public Size constrain(VideoConstraints constraints, boolean preserveAspectRatio) { int maxSize = constraints.getMaxSize(); int alignment = constraints.getAlignment(); + MediaCodecInfo.VideoCapabilities caps = constr...
bad
review
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
diff --git a/server/src/main/java/com/genymobile/scrcpy/model/Size.java b/server/src/main/java/com/genymobile/scrcpy/model/Size.java index 63648a9e8f..51211969e2 100644 --- a/server/src/main/java/com/genymobile/scrcpy/model/Size.java +++ b/server/src/main/java/com/genymobile/scrcpy/model/Size.java @@ -1,8 +1,12 @@ pac...
good
review_fixed
java
Genymobile/scrcpy
f457fd4cf5ff4e91853159cbbbbbb98efa8f30b3
@@ -54,6 +54,7 @@ struct sc_recorder { bool audio_init; bool audio_expects_config_packet; + bool video_expects_config_packet;
bad
review
c
Genymobile/scrcpy
0bdd750447b0826039d8c6111c2c21dc10d70af1
diff --git a/app/src/recorder.h b/app/src/recorder.h index 70b738362c..8638c72ee6 100644 --- a/app/src/recorder.h +++ b/app/src/recorder.h @@ -53,6 +53,7 @@ struct sc_recorder { bool video_init; bool audio_init; + bool video_expects_config_packet; bool audio_expects_config_packet; struct sc_r...
good
review_fixed
c
Genymobile/scrcpy
0bdd750447b0826039d8c6111c2c21dc10d70af1
@@ -785,6 +791,7 @@ sc_recorder_init(struct sc_recorder *recorder, const char *filename, recorder->audio_init = false; recorder->audio_expects_config_packet = false; + recorder->video_expects_config_packet = false;
bad
review
c
Genymobile/scrcpy
0bdd750447b0826039d8c6111c2c21dc10d70af1
diff --git a/app/src/recorder.c b/app/src/recorder.c index f6d5fe4cc0..5c5121b103 100644 --- a/app/src/recorder.c +++ b/app/src/recorder.c @@ -181,7 +181,8 @@ sc_recorder_close_output_file(struct sc_recorder *recorder) { static inline bool sc_recorder_must_wait_for_config_packets(struct sc_recorder *recorder) { - ...
good
review_fixed
c
Genymobile/scrcpy
0bdd750447b0826039d8c6111c2c21dc10d70af1