Skip to content

Commit

Permalink
Bump facebook/hhvm version to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed Mar 4, 2024
1 parent df7968c commit f4be90d
Show file tree
Hide file tree
Showing 8 changed files with 267 additions and 1,339 deletions.
1,499 changes: 246 additions & 1,253 deletions hhvm-patch.diff

Large diffs are not rendered by default.

33 changes: 3 additions & 30 deletions src/analyzer/expression_analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ use hakana_type::{
get_bool, get_false, get_float, get_int, get_literal_int, get_literal_string, get_mixed_any,
get_null, get_true, wrap_atomic,
};
use oxidized::ast::Field;
use oxidized::pos::Pos;
use oxidized::{aast, ast_defs};
use rustc_hash::{FxHashMap, FxHashSet};
Expand Down Expand Up @@ -142,9 +141,9 @@ pub(crate) fn analyze(
as_analyzer::analyze(
statements_analyzer,
expr.pos(),
&boxed.0,
&boxed.1,
boxed.2,
&boxed.expr,
&boxed.hint,
boxed.is_nullable,
analysis_data,
context,
if_body_context,
Expand Down Expand Up @@ -502,32 +501,6 @@ pub(crate) fn analyze(
);
}
}
aast::Expr_::Darray(boxed) => {
let fields = boxed
.1
.iter()
.map(|(key_expr, value_expr)| Field(key_expr.clone(), value_expr.clone()))
.collect::<Vec<_>>();

collection_analyzer::analyze_keyvals(
statements_analyzer,
&oxidized::tast::KvcKind::Dict,
&fields,
expr.pos(),
analysis_data,
context,
)?;
}
aast::Expr_::Varray(boxed) => {
collection_analyzer::analyze_vals(
statements_analyzer,
&oxidized::tast::VcKind::Vec,
&boxed.1,
expr.pos(),
analysis_data,
context,
)?;
}
aast::Expr_::ValCollection(boxed) => {
collection_analyzer::analyze_vals(
statements_analyzer,
Expand Down
1 change: 0 additions & 1 deletion src/analyzer/stmt/control_analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,6 @@ pub(crate) fn get_control_actions(
aast::Stmt_::Using(_) => {}
aast::Stmt_::Noop => {}
aast::Stmt_::Markup(_) => {}
aast::Stmt_::AssertEnv(_) => {}
aast::Stmt_::DeclareLocal(_) => {}
aast::Stmt_::Match(_) => {}
}
Expand Down
2 changes: 1 addition & 1 deletion src/analyzer/stmt_analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ pub(crate) fn analyze(
}
}
aast::Stmt_::Fallthrough => {} // do nothing
aast::Stmt_::YieldBreak | aast::Stmt_::AssertEnv(_) | aast::Stmt_::Match(_) => {
aast::Stmt_::YieldBreak | aast::Stmt_::Match(_) => {
//println!("{:#?}", stmt);
analysis_data.maybe_add_issue(
Issue::new(
Expand Down
47 changes: 0 additions & 47 deletions src/code_info_builder/simple_type_inferer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,53 +205,6 @@ pub fn infer(
None
}
aast::Expr_::Eif(_) => None,
aast::Expr_::Darray(boxed) => {
let mut known_items = BTreeMap::new();

for (key_expr, value_expr) in &boxed.1 {
if let aast::Expr_::String(key_value) = &key_expr.2 {
let value_type = infer(value_expr, resolved_names);

if let Some(value_type) = value_type {
known_items.insert(
DictKey::String(key_value.to_string()),
(false, Arc::new(value_type)),
);
} else {
return None;
}
} else {
return None;
}
}

Some(wrap_atomic(TAtomic::TDict {
non_empty: !known_items.is_empty(),
known_items: Some(known_items),
params: None,
shape_name: None,
}))
}
aast::Expr_::Varray(boxed) => {
let mut entries = BTreeMap::new();

for (i, entry_expr) in boxed.1.iter().enumerate() {
let entry_type = infer(entry_expr, resolved_names);

if let Some(entry_type) = entry_type {
entries.insert(i, (false, entry_type));
} else {
return None;
}
}

Some(wrap_atomic(TAtomic::TVec {
known_count: Some(entries.len()),
known_items: Some(entries),
type_param: Box::new(get_nothing()),
non_empty: true,
}))
}
aast::Expr_::New(..) => None,
aast::Expr_::Omitted => None,
_ => {
Expand Down
19 changes: 16 additions & 3 deletions src/code_info_builder/typehint_resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,6 @@ pub fn get_type_from_hint(
}
}
Hint_::Hmixed => TAtomic::TMixed,
Hint_::Hany => TAtomic::TMixedWithFlags(true, false, false, false),
Hint_::Hshape(shape_info) => {
get_shape_type_from_hints(shape_info, classlike_name, type_context, resolved_names)
}
Expand All @@ -553,7 +552,22 @@ pub fn get_type_from_hint(

last.unwrap()
}
Hint_::Hlike(_) => panic!(),
Hint_::Hlike(inner) => {
let union =
get_type_from_hint(&inner.1, classlike_name, type_context, resolved_names).unwrap();

let mut last = None;

for atomic_type in union.types.into_iter() {
if last.is_none() {
last = Some(atomic_type);
} else {
types.push(atomic_type);
}
}

last.unwrap()
}
Hint_::Hfun(hint_fun) => {
get_function_type_from_hints(hint_fun, classlike_name, type_context, resolved_names)
}
Expand All @@ -580,7 +594,6 @@ pub fn get_type_from_hint(
Hint_::Hsoft(hint) => {
return get_type_from_hint(&hint.1, classlike_name, type_context, resolved_names);
}
Hint_::Herr => panic!(),
Hint_::Hnonnull => TAtomic::TMixedWithFlags(false, false, false, true),
Hint_::Habstr(_, _) => panic!(),
Hint_::HvecOrDict(_, _) => panic!(),
Expand Down
3 changes: 0 additions & 3 deletions tests/inference/DictVecKeyset/darray/input.hack

This file was deleted.

2 changes: 1 addition & 1 deletion third-party/hhvm
Submodule hhvm updated 17788 files

0 comments on commit f4be90d

Please sign in to comment.