Skip to content

Commit

Permalink
Update to latest HHVM
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed Oct 24, 2023
1 parent 81d1c52 commit 9b7bfa7
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 22 deletions.
18 changes: 9 additions & 9 deletions hhvm-patch.diff
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ index a7681402058..e294b709695 100644
fn to_sql(&self) -> rusqlite::Result<rusqlite::types::ToSqlOutput<'_>> {
Ok(rusqlite::types::ToSqlOutput::from(*self as i64))
diff --git a/hphp/hack/src/naming/names_rust/Cargo.toml b/hphp/hack/src/naming/names_rust/Cargo.toml
index 565554d8203..db38316ce81 100644
index 04a55a0818b..57fd1676124 100644
--- a/hphp/hack/src/naming/names_rust/Cargo.toml
+++ b/hphp/hack/src/naming/names_rust/Cargo.toml
@@ -16,6 +16,8 @@ oxidized = { version = "0.0.0", path = "../../oxidized" }
Expand Down Expand Up @@ -161,7 +161,7 @@ index 91106097aa3..930dfa897c5 100644
fn to_sql(&self) -> rusqlite::Result<rusqlite::types::ToSqlOutput<'_>> {
Ok(rusqlite::types::ToSqlOutput::from(self.0.get() as i64))
diff --git a/hphp/hack/src/naming/names_rust/naming_sqlite.rs b/hphp/hack/src/naming/names_rust/naming_sqlite.rs
index e7f91b56e96..7be4f159ecf 100644
index 16288300007..396d281c283 100644
--- a/hphp/hack/src/naming/names_rust/naming_sqlite.rs
+++ b/hphp/hack/src/naming/names_rust/naming_sqlite.rs
@@ -12,8 +12,11 @@ use hh24_types::ToplevelCanonSymbolHash;
Expand All @@ -177,10 +177,10 @@ index e7f91b56e96..7be4f159ecf 100644

pub struct Names {
diff --git a/hphp/hack/src/oxidized/aast_visitor/node_impl_gen.rs b/hphp/hack/src/oxidized/aast_visitor/node_impl_gen.rs
index cfc3b81042c..e3e7a5b8fc0 100644
index 7d7a79b7c30..b336df0cb24 100644
--- a/hphp/hack/src/oxidized/aast_visitor/node_impl_gen.rs
+++ b/hphp/hack/src/oxidized/aast_visitor/node_impl_gen.rs
@@ -2247,7 +2247,6 @@ impl<P: Params> Node<P> for Typedef<P::Ex, P::En> {
@@ -2249,7 +2249,6 @@ impl<P: Params> Node<P> for Typedef<P::Ex, P::En> {
self.file_attributes.accept(c, v)?;
self.mode.accept(c, v)?;
self.vis.accept(c, v)?;
Expand All @@ -189,10 +189,10 @@ index cfc3b81042c..e3e7a5b8fc0 100644
self.emit_id.accept(c, v)?;
self.is_ctx.accept(c, v)?;
diff --git a/hphp/hack/src/oxidized/aast_visitor/node_mut_impl_gen.rs b/hphp/hack/src/oxidized/aast_visitor/node_mut_impl_gen.rs
index 2df37947608..1943892a3e3 100644
index d6eece3d383..b7e42eaa7e4 100644
--- a/hphp/hack/src/oxidized/aast_visitor/node_mut_impl_gen.rs
+++ b/hphp/hack/src/oxidized/aast_visitor/node_mut_impl_gen.rs
@@ -2247,7 +2247,6 @@ impl<P: Params> NodeMut<P> for Typedef<P::Ex, P::En> {
@@ -2249,7 +2249,6 @@ impl<P: Params> NodeMut<P> for Typedef<P::Ex, P::En> {
self.file_attributes.accept(c, v)?;
self.mode.accept(c, v)?;
self.vis.accept(c, v)?;
Expand Down Expand Up @@ -488,10 +488,10 @@ index 8db2f3a3271..cadcc02dbbf 100644
}
_ => {
diff --git a/hphp/hack/src/parser/lowerer/lowerer.rs b/hphp/hack/src/parser/lowerer/lowerer.rs
index 978ee9dd0b7..1bf7e45930d 100644
index c396766a467..c7c22b8bffe 100644
--- a/hphp/hack/src/parser/lowerer/lowerer.rs
+++ b/hphp/hack/src/parser/lowerer/lowerer.rs
@@ -3491,12 +3491,12 @@ fn p_markup<'a>(node: S<'a>, env: &mut Env<'a>) -> Result<ast::Stmt> {
@@ -3271,12 +3271,12 @@ fn p_markup<'a>(node: S<'a>, env: &mut Env<'a>) -> Result<ast::Stmt> {
let markup_hashbang = &c.hashbang;
let markup_suffix = &c.suffix;
let pos = p_pos(node, env);
Expand Down Expand Up @@ -557,7 +557,7 @@ index 88c2e445a47..7aab53c3f1c 100644
acc.add_to_misuses(line, code, p);
} else if self.disable_hh_ignore_error == 1 && t.kind() == IgnoreError {
diff --git a/hphp/hack/src/providers/hackrs_provider_backend/Cargo.toml b/hphp/hack/src/providers/hackrs_provider_backend/Cargo.toml
index 9222ad8eac1..e332c3999be 100644
index 5a0b574800f..154f2cdb3d5 100644
--- a/hphp/hack/src/providers/hackrs_provider_backend/Cargo.toml
+++ b/hphp/hack/src/providers/hackrs_provider_backend/Cargo.toml
@@ -23,7 +23,6 @@ names = { version = "0.0.0", path = "../../naming/names_rust" }
Expand Down
34 changes: 21 additions & 13 deletions src/analyzer/expression_analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,10 @@ pub(crate) fn analyze(

if let Some(stmt_type) = analysis_data
.expr_types
.get(&(boxed.pos().start_offset() as u32, boxed.pos().end_offset() as u32))
.get(&(
boxed.pos().start_offset() as u32,
boxed.pos().end_offset() as u32,
))
.cloned()
{
analysis_data.expr_types.insert(
Expand Down Expand Up @@ -459,9 +462,10 @@ pub(crate) fn analyze(
.cloned()
.unwrap_or(get_mixed_any());

analysis_data
.expr_effects
.insert((expr.1.start_offset() as u32, expr.1.end_offset() as u32), EFFECT_IMPURE);
analysis_data.expr_effects.insert(
(expr.1.start_offset() as u32, expr.1.end_offset() as u32),
EFFECT_IMPURE,
);

let awaited_types = awaited_stmt_type.types.drain(..).collect::<Vec<_>>();

Expand Down Expand Up @@ -613,6 +617,7 @@ pub(crate) fn analyze(
| aast::Expr_::Pair(_)
| aast::Expr_::ETSplice(_)
| aast::Expr_::Hole(_)
| aast::Expr_::Nameof(_)
| aast::Expr_::Invalid(_) => {
analysis_data.maybe_add_issue(
Issue::new(
Expand Down Expand Up @@ -847,7 +852,10 @@ fn analyze_function_pointer(
false,
);

if !codebase.functionlike_infos.contains_key(&(*name, STR_EMPTY)) {
if !codebase
.functionlike_infos
.contains_key(&(*name, STR_EMPTY))
{
analysis_data.maybe_add_issue(
Issue::new(
IssueKind::NonExistentFunction,
Expand Down Expand Up @@ -945,10 +953,10 @@ pub(crate) fn add_decision_dataflow(
statements_analyzer.get_hpos(expr_pos),
);

if let Some(lhs_type) = analysis_data
.expr_types
.get(&(lhs_expr.1.start_offset() as u32, lhs_expr.1.end_offset() as u32))
{
if let Some(lhs_type) = analysis_data.expr_types.get(&(
lhs_expr.1.start_offset() as u32,
lhs_expr.1.end_offset() as u32,
)) {
cond_type.parent_nodes.insert(decision_node.clone());

for old_parent_node in &lhs_type.parent_nodes {
Expand All @@ -963,10 +971,10 @@ pub(crate) fn add_decision_dataflow(
}

if let Some(rhs_expr) = rhs_expr {
if let Some(rhs_type) = analysis_data
.expr_types
.get(&(rhs_expr.1.start_offset() as u32, rhs_expr.1.end_offset() as u32))
{
if let Some(rhs_type) = analysis_data.expr_types.get(&(
rhs_expr.1.start_offset() as u32,
rhs_expr.1.end_offset() as u32,
)) {
cond_type.parent_nodes.insert(decision_node.clone());

for old_parent_node in &rhs_type.parent_nodes {
Expand Down
1 change: 1 addition & 0 deletions src/code_info_builder/typehint_resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ pub fn get_type_from_hint(
Hint_::HfunContext(_) => panic!(),
Hint_::Hvar(_) => panic!(),
Hint_::Hrefinement(_, _) => panic!(),
Hint_::HclassArgs(_) => panic!(),
Hint_::Hwildcard => TAtomic::TPlaceholder,
};

Expand Down

0 comments on commit 9b7bfa7

Please sign in to comment.